public async Task GetListReturnsFieldsAndCorrectContentType() { // Given A.CallTo(() => _fakeQuery.GetAll()).Returns(A.Fake <IEnumerable <Field> >()); // When HttpResponseMessage response = await Client.GetAsync(EndPointFactory.ListEndpoint()); // Then response.StatusCode.Should().Be(HttpStatusCode.OK); response.Content.Headers.ContentType.ToString().Should().Be("application/json; charset=utf-8"); A.CallTo(() => _fakeQuery.GetAll()).MustHaveHappenedOnceExactly(); }
public async Task <ActionResult <IEnumerable <FieldIndexViewModel> > > Get() { IEnumerable <Field> fields = await _queries.GetAll(); return(Ok(_mapper.Map <IEnumerable <FieldIndexViewModel> >(fields))); }