public void HasClaimsReturnsExpectedResult(IEnumerable<Claim> claims, bool expected) { var principalClaims = new List<Claim> { new Claim("one", "one"), new Claim("two", "two") }; var sut = new ClaimsPrincipal(new ClaimsIdentity(principalClaims)); Assert.Equal(expected, sut.HasClaims(claims)); }
public void HasClaimsWithNullClaimsThrowsArgumentNullException() { var sut = new ClaimsPrincipal(); var ex = Assert.Throws<ArgumentNullException>(() => sut.HasClaims(null)); Assert.Equal("claims", ex.ParamName); }