public async Task Get_ReturnsListOfItems() { _repository.GetAllItemsAsync().Returns(Task.FromResult(_items)); var message = await _listController.ExecuteAction(controller => controller.GetAsync()); message.TryGetContentValue(out IEnumerable <ListItem> items); Assert.That(message.StatusCode, Is.EqualTo(HttpStatusCode.OK)); Assert.That(items, Is.EqualTo(_items).Using(_listItemEqualityComparer)); }
public async Task <IHttpActionResult> GetAllItemsAsync() => Ok(await _repository.GetAllItemsAsync());