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()); }
public void NullType_Throws() { var sub = new UserAccount(); sub.GetClaimValues(null); }
public void EmptyType_Throws() { var sub = new UserAccount(); sub.GetClaimValues(""); }
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()); }