public async Task <Dictionary <Guid, Summary> > GetSessionSummariesAsync() { try { return((await SummarySvc.GetAllAsync()) .ToDictionary(x => x.Id)); } catch (Exception e) { throw new FaultException <Exception>(e); } }
public void FindAllAsync_Works() { var daos = new[] { new SummaryDao { Cardroom = "Beltera", DayOfMonth = 14, EndTime = DateTime.Now.AddHours(-2), Game = "No Limit Hold 'Em", HourlyRate = 14, HourlyRateBB = 4.1m, HoursPlayed = 1.4m, Limit = "$1/$2", SessionId = Guid.NewGuid(), StartTime = DateTime.Now.AddHours(-8), WinLoss = 140, WinLossBB = 70 }, new SummaryDao { Cardroom = "Private Room", DayOfMonth = 2, EndTime = DateTime.Now.AddDays(-1).AddHours(2), Game = "Seven Card Stud", HourlyRate = -14, HourlyRateBB = -1.5m, HoursPlayed = 3m, Limit = "$2/$4", SessionId = Guid.NewGuid(), StartTime = DateTime.Now.AddDays(-1), WinLoss = -280, WinLossBB = -20 } }; RepoMock.DaoList.AddRange(daos); var objects = _summarySvc.GetAllAsync().Result; AssertDaoToListWithId <SummaryDao, Summary>(x => x.SessionId, y => y.Id, daos, objects, new SummaryComparer()); }