Example #1
0
            public void CopiesAllValues()
            {
                var minimalClaim = new Claim("t1", "v1", "vt", "i", "oi");

                ClaimDataRecord actual = null;
                Action          act    = () => actual = ClaimDataRecord.FromClaim(minimalClaim);

                act.Should().NotThrow();

                var expected = new ClaimDataRecord {
                    Type        = "t1",
                    Value       = "v1",
                    OriginalIss = "oi",
                    Iss         = "i",
                    ValueType   = "vt"
                };

                actual.Should().BeEquivalentTo(expected);
            }
Example #2
0
            public void GivenMinimalClaim_DoesNotThrow()
            {
                var minimalClaim = new Claim("t1", "v1");

                ClaimDataRecord actual = null;
                Action          act    = () => actual = ClaimDataRecord.FromClaim(minimalClaim);

                act.Should().NotThrow();

                var expected = new ClaimDataRecord {
                    Type        = "t1",
                    Value       = "v1",
                    OriginalIss = "LOCAL AUTHORITY",
                    Iss         = "LOCAL AUTHORITY",
                    ValueType   = "http://www.w3.org/2001/XMLSchema#string"
                };

                actual.Should().BeEquivalentTo(expected);
            }
Example #3
0
 public ClaimDataRecordTests()
 {
     _sut = new ClaimDataRecord();
 }
Example #4
0
            public void GivenNullClaim_ThrowsArgumentNullException()
            {
                Action act = () => ClaimDataRecord.FromClaim(null);

                act.Should().Throw <ArgumentNullException>();
            }