コード例 #1
0
        public void BetRepository_FindAll_ReturnsAllBets()
        {
            var bets        = GetTestBets().ToList();
            var mockDbSet   = UnitTestHelper.GetMockDbSet <Bet>(bets.AsQueryable());
            var mockContext = GetMockContext(mockDbSet);
            var betRepo     = new BetRepository(mockContext.Object);

            var result = betRepo.FindAll().ToList();

            Assert.AreEqual(bets.Count, result.Count);
            for (int i = 0; i < result.Count; i++)
            {
                Assert.AreEqual(bets[i].Id, result[i].Id);
                Assert.AreEqual(bets[i].BetDate, result[i].BetDate);
                Assert.AreEqual(bets[i].LotId, result[i].LotId);
            }
        }