public void Essential_should_be_valid_with_custom_fields() { var sampleDate = DateTime.Now; var sut = Trusonafication.Essential() .UserIdentifier("jones") .Action("sit") .Resource("your lap") .ExpiresAt(sampleDate) .WithoutPrompt() .WithoutUserPresence() .WithCustomFields(new Dictionary <string, object> { { "african", "tiger" }, { "taco", 1 } }) .Build(); //then sut.DesiredLevel.Should().Be(1); sut.ExpiresAt.Should().Be(sampleDate.ToUniversalTime()); sut.Prompt.Should().BeFalse(); sut.UserPresence.Should().BeFalse(); sut.ShowIdentityDocument.Should().BeFalse(); sut.CustomFields.GetValueOrDefault("african", null).Should().Be("tiger"); sut.CustomFields.GetValueOrDefault("taco", null).Should().Be(1); }
public void Essential_should_be_valid_with_email_address() { var sut = Trusonafication.Essential() .EmailAddress("*****@*****.**") .Action("sit") .Resource("your lap") .Build(); //then sut.DesiredLevel.Should().Be(2); sut.DeviceIdentifier.Should().BeNull(); sut.EmailAddress.Should().Be("*****@*****.**"); sut.Action.Should().Be("sit"); sut.Resource.Should().Be("your lap"); sut.Prompt.Should().BeTrue(); sut.UserPresence.Should().BeTrue(); sut.ShowIdentityDocument.Should().BeFalse(); }
public void Essential_should_be_valid_with_device_identifier() { var sut = Trusonafication.Essential() .DeviceIdentifier("someDevice") .Action("sit") .Resource("your lap") .Build(); //then sut.DesiredLevel.Should().Be(2); sut.DeviceIdentifier.Should().Be("someDevice"); sut.UserIdentifier.Should().BeNull(); sut.Action.Should().Be("sit"); sut.Resource.Should().Be("your lap"); sut.Prompt.Should().BeTrue(); sut.UserPresence.Should().BeTrue(); sut.ShowIdentityDocument.Should().BeFalse(); }
public void Executive_should_be_valid_with_user_identifier() { var sut = Trusonafication.Executive() .UserIdentifier("jones") .Action("sit") .Resource("your lap") .Build(); //then sut.DesiredLevel.Should().Be(3); sut.DeviceIdentifier.Should().BeNull(); sut.UserIdentifier.Should().Be("jones"); sut.Action.Should().Be("sit"); sut.Resource.Should().Be("your lap"); sut.Prompt.Should().BeTrue(); sut.UserPresence.Should().BeTrue(); sut.ShowIdentityDocument.Should().BeTrue(); }
public void Essential_should_be_valid_with_finalize_options() { var sampleDate = DateTime.Now; var sut = Trusonafication.Essential() .UserIdentifier("jones") .Action("sit") .Resource("your lap") .ExpiresAt(sampleDate) .WithoutPrompt() .WithoutUserPresence() .Build(); //then sut.DesiredLevel.Should().Be(1); sut.ExpiresAt.Should().Be(sampleDate.ToUniversalTime()); sut.Prompt.Should().BeFalse(); sut.UserPresence.Should().BeFalse(); sut.ShowIdentityDocument.Should().BeFalse(); }
protected Builder(int desiredLevel) { _trusonafication = new Trusonafication(); _trusonafication.DesiredLevel = desiredLevel; }