public void MissingTenantReturnsFalse() { var authenticator = new AzureActiveDirectoryV2Authenticator(); var claimsIdentity = new ClaimsIdentity(new[] { TestData.Issuer, TestData.Identifier, }); // Act and assert Assert.False(authenticator.IsProviderForIdentity(claimsIdentity)); }
public void CorrectClaimsReturnTrue() { var authenticator = new AzureActiveDirectoryV2Authenticator(); var claimsIdentity = new ClaimsIdentity(new[] { TestData.Issuer, TestData.TenantId, TestData.Identifier }); // Act and assert Assert.True(authenticator.IsProviderForIdentity(claimsIdentity)); }
public void WrongIssuerReturnsFalse() { var authenticator = new AzureActiveDirectoryV2Authenticator(); var claimsIdentity = new ClaimsIdentity(new[] { new Claim(AzureActiveDirectoryV2Authenticator.V2Claims.Issuer, "wrong issuer", ClaimValueTypes.String, TestData.Authority), TestData.TenantId, TestData.Identifier }); // Act and assert Assert.False(authenticator.IsProviderForIdentity(claimsIdentity)); }