public async Task An_Error_Is_Returned() { var sut = new GetCustomersFixture(); var response = (IStatusCodeActionResult)await sut.GetCustomers("Joe", "Blogs"); response.StatusCode.Should().Be((int)HttpStatusCode.NotFound); }
public async Task The_Customers_Are_Returned(GetCustomersTheoryData theoryData) { var expectedResponse = new ObjectResult(theoryData.ExpectedResponse) { StatusCode = (int)HttpStatusCode.OK }; GetCustomersFixture sut = new GetCustomersFixture() .WithCustomerRepositoryData(theoryData.ExistingCustomers); IActionResult response = await sut.GetCustomers(theoryData.FirstName, theoryData.LastName); ((ObjectResult)response).Should().BeEquivalentTo(expectedResponse); }