public void HasClaimTypesWithNullClaimTypesThrowsArgumentNullException() { var sut = new ClaimsPrincipal(); var ex = Assert.Throws<ArgumentNullException>(() => sut.HasClaimTypes(null)); Assert.Equal("claimTypes", ex.ParamName); }
public void HasClaimTypesReturnsExpectedResult(IEnumerable<string> claimTypes, 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.HasClaimTypes(claimTypes)); }