public async void return_a_201_http_status_code_when_creating_a_document() { WebApiConfig.Container.RegisterInstance(documentService); var document = new ComparableDocument().WithTitle(AnyTitle); var response = await restClient.PostAsJson("documents/", document); documentService.Received().Create(document); response.StatusCode.Should().Be(HttpStatusCode.Created); }
public async Task return_a_404_http_status_code_when_updating_no_existing_document() { GivenAWebApiWithDocumentServiceWithoutDocuments(); var document = new ComparableDocument().WithId(AnyId); var response = await restClient.PutAsJson("documents/" + document.Id, document); documentService.Received().Update(document); response.StatusCode.Should().Be(HttpStatusCode.NotFound); }
public async void return_a_200_http_status_code_when_updated_a_document() { WebApiConfig.Container.RegisterInstance(documentService); var document = new ComparableDocument().WithId(AnyId); var response = await restClient.PutAsJson("documents/" + document.Id, document); documentService.Received().Update(document); response.StatusCode.Should().Be(HttpStatusCode.Accepted); }