Example #1
0
        public void FindAllForUser_ShouldFindAllShoppingLists_ForTheGivenCreator()
        {
            var testDataKeys = CreateTestData();

            using (var dbContext = TestUtils.CreateDbContext(_connection))
                using (IUnitOfWork unitOfWork = new EfUnitOfWork(dbContext))
                {
                    var shoppingListRepository = new ShoppingListRepository(dbContext);
                    var shoppingLists          = shoppingListRepository.FindAllForUser(testDataKeys.UserId).ToList();
                    Assert.AreEqual(testDataKeys.UserId, shoppingLists[0].CreatorId);
                    Assert.AreEqual(testDataKeys.UserId, shoppingLists[1].CreatorId);
                }
        }