コード例 #1
0
 public void TypeNotInList_ReturnsEmptyCollection()
 {
     var sub = new UserAccount();
     sub.Claims = new UserClaim[]{
         new UserClaim{Type="type1", Value="a"},
         new UserClaim{Type="type1", Value="b"},
         new UserClaim{Type="type2", Value="c"},
     };
     var result = sub.GetClaimValues("type");
     Assert.AreEqual(0, result.Count());
 }
コード例 #2
0
 public void NullType_Throws()
 {
     var sub = new UserAccount();
     sub.GetClaimValues(null);
 }
コード例 #3
0
 public void EmptyType_Throws()
 {
     var sub = new UserAccount();
     sub.GetClaimValues("");
 }
コード例 #4
0
 public void TypeInList_ReturnsCurrentValues()
 {
     var sub = new UserAccount();
     sub.Claims = new UserClaim[]{
         new UserClaim{Type="type1", Value="a"},
         new UserClaim{Type="type1", Value="b"},
         new UserClaim{Type="type2", Value="c"},
     };
     var result = sub.GetClaimValues("type1");
     Assert.AreEqual(2, result.Count());
     CollectionAssert.AreEquivalent(new string[] { "a", "b" }, result.ToArray());
 }