public void Handle_Read_PassesForContributor()
{
var survey = new Survey("test survey") { Contributors = new List<SurveyContributor> { new SurveyContributor { UserId = 54321 } } };
var principal = new ClaimsPrincipal(new ClaimsIdentity(new[]
{
new Claim(SurveyClaimTypes.SurveyUserIdClaimType, "54321"),
new Claim(SurveyClaimTypes.SurveyTenantIdClaimType, "12345"),
new Claim(AzureADClaimTypes.TenantId, "tenantid")
}));
var authzContext = new AuthorizationContext(new IAuthorizationRequirement[] { }, principal, survey);
var target = new TestableSurveyAuthorizationHandler();
target.Handle(authzContext, Operations.Read, survey);
Assert.True(authzContext.HasSucceeded);
}