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); }
public YotiTokenRequest(string rememberMeId, ReadOnlyCollection <SandboxAttribute> sandboxAttributes, SandboxExtraData extraData = null) { RememberMeId = rememberMeId; SandboxAttributes = sandboxAttributes; ExtraData = extraData; }
public YotiTokenRequestBuilder WithExtraData(SandboxExtraData extraData) { _extraData = extraData; return(this); }