public static void ShouldCreateRequestWithExtraData() { SandboxAttributeIssuanceDetails sandboxAttributeIssuanceDetails = new SandboxAttributeIssuanceDetailsBuilder() .WithDefinition("attributeName") .WithExpiryDate(new DateTime(2030, 12, 31, 12, 23, 59, 999)) .WithIssuanceToken("issuanceToken") .Build(); var extraData = new SandboxExtraData( new List <SandboxBaseDataEntry> { sandboxAttributeIssuanceDetails }); YotiTokenRequest yotiTokenRequest = YotiTokenRequest.Builder() .WithExtraData(extraData) .Build(); var baseResult = yotiTokenRequest.ExtraData.DataEntries.Single(); var result = baseResult as SandboxDataEntry <SandboxAttributeIssuanceDetailsValue>; Assert.Equal("THIRD_PARTY_ATTRIBUTE", result.Type); Assert.Equal("attributeName", result.Value.IssuingAttributes.Definitions.Single().Name); Assert.Equal("2030-12-31T12:23:59.999Z", result.Value.IssuingAttributes.ExpiryDate); Assert.Equal("issuanceToken", result.Value.IssuanceToken); }
public static void ShouldHaveNullExpiryDateIfNotSpecified() { SandboxAttributeIssuanceDetails sandboxAttributeIssuanceDetails = new SandboxAttributeIssuanceDetailsBuilder() .WithDefinition("attributeName") .WithIssuanceToken("issuanceToken") .Build(); var extraData = new SandboxExtraData( new List <SandboxBaseDataEntry> { sandboxAttributeIssuanceDetails }); YotiTokenRequest yotiTokenRequest = YotiTokenRequest.Builder() .WithExtraData(extraData) .Build(); var baseResult = yotiTokenRequest.ExtraData.DataEntries.Single(); var result = baseResult as SandboxDataEntry <SandboxAttributeIssuanceDetailsValue>; Assert.Null(result.Value.IssuingAttributes.ExpiryDate); }