public async Task Test_List_ReturnsValidObject() { var mockOdd = new List <Odd>() { GenerateOddMock(), GenerateOddMock() }; var id = Guid.NewGuid(); mockOdd[1].Id = id; _oddsRepository.ListAsync <Odd>().Returns(mockOdd); var result = await sut.ListAsync(); Assert.IsInstanceOf <List <OddDto> >(result); Assert.AreEqual(result[1].Id, id); }
public async Task <List <OddDto> > ListAsync() { return((await _oddsRepository.ListAsync <Odd>()).Select(Map).ToList()); }