public async Task WhenExportResources_GivenAUserWithExportPermissions_TheServerShouldReturnSuccess() { FhirClient tempClient = Client.CreateClientForUser(TestUsers.ExportUser, TestApplications.NativeClient); await tempClient.ExportAsync(_exportQueryParams); }
public async Task WhenExportResources_GivenAUserWithNoExportPermissions_TheServerShouldReturnForbidden() { FhirClient tempClient = Client.CreateClientForUser(TestUsers.ReadOnlyUser, TestApplications.NativeClient); FhirException fhirException = await Assert.ThrowsAsync <FhirException>(async() => await tempClient.ExportAsync(_exportQueryParams)); Assert.Equal(ForbiddenMessage, fhirException.Message); Assert.Equal(HttpStatusCode.Forbidden, fhirException.StatusCode); }