Skip to content

Commit

Permalink
Merge branch 'Release/1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
echarrod committed Mar 23, 2021
2 parents 171ad52 + 4b9d54a commit 04d5b1d
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ public void TestProfile()
Assert.AreEqual("some@email", activityDetails.Profile.EmailAddress.GetValue());
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using Xunit;
using Yoti.Auth.Sandbox.DocScan.Request.Check;
using Yoti.Auth.Sandbox.DocScan.Request.Check.Report;

namespace Yoti.Auth.Sandbox.Tests.DocScan.Request.Check
{
public class SandboxThirdPartyIdentityCheckBuilderTests
{
private readonly SandboxBreakdown _someBreakDown = new SandboxBreakdown("someSubCheck", "someResult", details: null);

[Fact]
public void ShouldNotBuildWithoutRecommendation()
{
var exception = Assert.Throws<ArgumentNullException>(() =>
{
new SandboxDocumentFaceMatchCheckBuilder()
.WithBreakdown(_someBreakDown)
.Build();
});

Assert.Contains("Recommendation", exception.Message, StringComparison.Ordinal);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
using Yoti.Auth.Sandbox.DocScan.Request.Task;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using Xunit;
using Yoti.Auth.Sandbox.DocScan.Request.Task;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ public static void BuilderShouldBuildWithAllArguments()
.WithValue("APPROVE")
.Build())
.Build())
.WithThirdPartyIdentityCheck(
new SandboxThirdPartyIdentityCheckBuilder()
.WithRecommendation(
new SandboxRecommendationBuilder()
.WithValue("APPROVE")
.Build())
.Build())
.Build();

Assert.Equal(10, sandboxCheckReport.AsyncReportDelay);
Expand Down
11 changes: 10 additions & 1 deletion Yoti.Auth.Sandbox.Tests/DocScan/SandboxCheckReportsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Xunit;
using Yoti.Auth.Sandbox.DocScan.Request;
using Yoti.Auth.Sandbox.DocScan.Request.Check;
using Yoti.Auth.Sandbox.DocScan.Request.Check.Report;

namespace Yoti.Auth.Sandbox.Tests.DocScan
{
Expand All @@ -10,14 +11,20 @@ public static class SandboxCheckReportTests
[Fact]
public static void ShouldCreateWithAllArgs()
{
var recommendation = new SandboxRecommendation("someValue", "someReason", "someRecoverySuggestion");
var sandboxThirdPartyIdentityCheck = new SandboxThirdPartyIdentityCheckBuilder()
.WithRecommendation(recommendation)
.Build();

var sandboxCheckReport = new SandboxCheckReports(
new List<SandboxDocumentTextDataCheck>(),
new List<SandboxDocumentAuthenticityCheck>(),
new List<SandboxLivenessCheck>(),
new List<SandboxDocumentFaceMatchCheck>(),
10,
new List<SandboxIdDocumentComparisonCheck>(),
new List<SandboxSupplementaryDocTextDataCheck>());
new List<SandboxSupplementaryDocTextDataCheck>(),
sandboxThirdPartyIdentityCheck);

Assert.NotNull(sandboxCheckReport.TextDataCheck);
Assert.NotNull(sandboxCheckReport.DocumentAuthenticityCheck);
Expand All @@ -26,6 +33,7 @@ public static void ShouldCreateWithAllArgs()
Assert.Equal(10, sandboxCheckReport.AsyncReportDelay);
Assert.NotNull(sandboxCheckReport.IdDocumentComparisonChecks);
Assert.NotNull(sandboxCheckReport.SupplementaryDocTextDataChecks);
Assert.NotNull(sandboxCheckReport.ThirdPartyIdentityCheck);
}

[Fact]
Expand All @@ -45,6 +53,7 @@ public static void ShouldCreateWithoutOptionals()
Assert.Equal(10, sandboxCheckReport.AsyncReportDelay);
Assert.Empty(sandboxCheckReport.IdDocumentComparisonChecks);
Assert.Empty(sandboxCheckReport.SupplementaryDocTextDataChecks);
Assert.Null(sandboxCheckReport.ThirdPartyIdentityCheck);
}
}
}
8 changes: 4 additions & 4 deletions Yoti.Auth.Sandbox.Tests/Yoti.Auth.Sandbox.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Moq" Version="4.14.7" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.15.2" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Yoti.Auth.Sandbox.DocScan.Request.Check
{
public class SandboxThirdPartyIdentityCheck : SandboxCheck
{
public SandboxThirdPartyIdentityCheck(SandboxCheckResult result)
: base(result)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Yoti.Auth.Sandbox.DocScan.Request.Check
{
public class SandboxThirdPartyIdentityCheckBuilder
: SandboxCheckBuilder<SandboxThirdPartyIdentityCheckBuilder, SandboxThirdPartyIdentityCheck>
{
public override SandboxThirdPartyIdentityCheck Build()
{
Validation.NotNull(Recommendation, nameof(Recommendation));

SandboxCheckReport report = new SandboxCheckReport(Recommendation, Breakdown);
SandboxCheckResult result = new SandboxCheckResult(report);

return new SandboxThirdPartyIdentityCheck(result);
}
}
}
7 changes: 6 additions & 1 deletion Yoti.Auth.Sandbox/DocScan/Request/SandboxCheckReports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public SandboxCheckReports(
List<SandboxDocumentFaceMatchCheck> documentFaceMatchChecks,
int? asyncReportDelay,
List<SandboxIdDocumentComparisonCheck> idDocumentComparisonChecks = null,
List<SandboxSupplementaryDocTextDataCheck> supplementaryDocTextDataChecks = null)
List<SandboxSupplementaryDocTextDataCheck> supplementaryDocTextDataChecks = null,
SandboxThirdPartyIdentityCheck thirdPartyIdentityCheck = null)
{
if (idDocumentComparisonChecks == null)
{
Expand All @@ -31,6 +32,7 @@ public SandboxCheckReports(
DocumentFaceMatchCheck = documentFaceMatchChecks;
IdDocumentComparisonChecks = idDocumentComparisonChecks;
SupplementaryDocTextDataChecks = supplementaryDocTextDataChecks;
ThirdPartyIdentityCheck = thirdPartyIdentityCheck;
AsyncReportDelay = asyncReportDelay;
}

Expand All @@ -52,6 +54,9 @@ public SandboxCheckReports(
[JsonProperty(PropertyName = "SUPPLEMENTARY_DOCUMENT_TEXT_DATA_CHECK")]
public List<SandboxSupplementaryDocTextDataCheck> SupplementaryDocTextDataChecks { get; }

[JsonProperty(PropertyName = "THIRD_PARTY_IDENTITY")]
public SandboxThirdPartyIdentityCheck ThirdPartyIdentityCheck { get; }

[JsonProperty(PropertyName = "async_report_delay")]
public int? AsyncReportDelay { get; }
}
Expand Down
10 changes: 9 additions & 1 deletion Yoti.Auth.Sandbox/DocScan/Request/SandboxCheckReportsBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class SandboxCheckReportsBuilder
private readonly List<SandboxDocumentFaceMatchCheck> _documentFaceMatchChecks;
private readonly List<SandboxIdDocumentComparisonCheck> _idDocumentComparisonChecks;
private readonly List<SandboxSupplementaryDocTextDataCheck> _supplementaryDocTextDataChecks;
private SandboxThirdPartyIdentityCheck _thirdPartyIdentityCheck;
private int? _asyncReportDelay;

public SandboxCheckReportsBuilder()
Expand Down Expand Up @@ -60,6 +61,12 @@ public SandboxCheckReportsBuilder WithSupplementaryDocTextDataCheck(SandboxSuppl
return this;
}

public SandboxCheckReportsBuilder WithThirdPartyIdentityCheck(SandboxThirdPartyIdentityCheck sandboxThirdPartyIdentityCheck)
{
_thirdPartyIdentityCheck = sandboxThirdPartyIdentityCheck;
return this;
}

public SandboxCheckReportsBuilder WithAsyncReportDelay(int asyncReportDelay)
{
_asyncReportDelay = asyncReportDelay;
Expand All @@ -75,7 +82,8 @@ public SandboxCheckReports Build()
_documentFaceMatchChecks,
_asyncReportDelay,
_idDocumentComparisonChecks,
_supplementaryDocTextDataChecks);
_supplementaryDocTextDataChecks,
_thirdPartyIdentityCheck);
}
}
}
8 changes: 4 additions & 4 deletions Yoti.Auth.Sandbox/Yoti.Auth.Sandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<PackageId>Yoti.Sandbox</PackageId>
<PackageProjectUrl>https://developers.yoti.com/yoti-app/web-integration</PackageProjectUrl>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<Version>1.5.0</Version>
<Version>1.6.0</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -29,16 +29,16 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.14.0.22654">
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.18.0.27296">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Yoti" Version="3.7.0" />
<PackageReference Include="Yoti" Version="3.8.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ steps:
scannerMode: 'MSBuild'
projectKey: 'getyoti:dotnet-sandbox'
projectName: '.NET SDK Sandbox'
projectVersion: '1.5.0'
projectVersion: '1.6.0'
extraProperties: |
sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml"
sonar.links.scm = https://github.com/getyoti/yoti-dotnet-sdk-sandbox
Expand Down

0 comments on commit 04d5b1d

Please sign in to comment.