private async Task CheckExceptionTranslatesIntoStatusCode <TException>(HttpStatusCode expectedStatusCode) where TException : Exception, new() { var fixtures = new OrganisationControllerTestFixtures() .SetQueryException <TException>(); var result = await fixtures.CallGetAsync("123", OrganisationType.Company); Assert.AreEqual(expectedStatusCode, result.StatusCode); }
private async Task CheckSuccessfulCallReturnsExpectedStatus(HttpStatusCode expectedStatusCode) { const string registeredId = "123"; const OrganisationType organisationType = OrganisationType.Company; var organisation = new Organisation { Type = organisationType, Code = registeredId }; var fixtures = new OrganisationControllerTestFixtures() .SetQueryResult(organisation); var result = await fixtures.CallGetAsync(registeredId, organisationType); Assert.AreEqual(expectedStatusCode, result.StatusCode); }