public async Task GetMemberUploadDataHandler_NotOrganisationUser_ThrowsSecurityException() { var denyingAuthorization = AuthorizationBuilder.CreateUserDeniedFromAccessingOrganisation(); var handler = new GetMemberUploadDataHandler(denyingAuthorization, A.Dummy <WeeeContext>(), A.Dummy <MemberUploadErrorMap>()); var message = new GetMemberUploadData(Guid.NewGuid(), Guid.NewGuid()); await Assert.ThrowsAsync <SecurityException>(async() => await handler.HandleAsync(message)); }
public async Task GetMemberUploadDataHandler_NotOrganisationUser_ThrowsSecurityException() { var denyingAuthorization = AuthorizationBuilder.CreateUserDeniedFromAccessingOrganisation(); var handler = new GetMemberUploadDataHandler(denyingAuthorization, A.Dummy<WeeeContext>(), A.Dummy<MemberUploadErrorMap>()); var message = new GetMemberUploadData(Guid.NewGuid(), Guid.NewGuid()); await Assert.ThrowsAsync<SecurityException>(async () => await handler.HandleAsync(message)); }