public async Task <IList <MyFoo> > ListMyFoos() { var request = new ListMyFoosRequest(); var response = await Service.ListMyFoosAsync(request); return(response.Records.Select(Get).ToList()); }
public async Task <ActionResult <ListMyFoosResponse> > ListMyFoosAsync() { var request = new ListMyFoosRequest(); var response = await Service.ListMyFoosAsync(request); return(Ok(response)); }
public async Task ListMyFoos_OK() { var listRequest = new ListMyFoosRequest { }; var actual = await Fixture.Api.MyFoos.ListMyFoosAsync(listRequest); Assert.Equal(HttpStatusCode.OK, actual.StatusCode); var actualContent = actual.Data; Assert.Equal(2, actualContent.Records.Count); var expectedFirst = _myFooRecords[0]; var actualFirst = actualContent.Records[0]; Assert.True(actualFirst.Id > 0); Assert.Equal(expectedFirst.FirstName, actualFirst.FirstName); Assert.Equal(expectedFirst.LastName, actualFirst.LastName); var expectedSecond = _myFooRecords[1]; var actualSecond = actualContent.Records[1]; Assert.True(actualSecond.Id > 0); Assert.Equal(expectedSecond.FirstName, actualSecond.FirstName); Assert.Equal(expectedSecond.LastName, actualSecond.LastName); }
public async Task ListMyFoos_ValidRequest_ReturnsResponse() { var request = new ListMyFoosRequest(); var actualResponse = await Fixture.MyFoos.ListMyFoosAsync(request); Assert.Equal(_myFooRecords.Count, actualResponse.Count); for (int i = 0; i < _myFooRecords.Count; i++) { var expectedRecord = _myFooRecords[i]; var actualRecord = actualResponse.Records[i]; Assert.Equal(expectedRecord.Id, actualRecord.Id); Assert.Equal(expectedRecord.FirstName, actualRecord.FirstName); Assert.Equal(expectedRecord.LastName, actualRecord.LastName); } }
public Task <IObjectClientResponse <ListMyFoosResponse> > ListMyFoosAsync(ListMyFoosRequest request) { return(Client.GetAsync <ListMyFoosResponse>()); }
public Task <ListMyFoosResponse> ListMyFoosAsync(ListMyFoosRequest request) { return(HandleAsync <ListMyFoosRequest, ListMyFoosResponse>(request)); }