Exemplo n.º 1
0
        public void FindAllForUser_ShouldFindAShoppingList_ForTheGivenTitleAndCreator()
        {
            var testDataKeys = CreateTestData();

            using (var dbContext = TestUtils.CreateDbContext(_connection, new MockUserContext(testDataKeys.UserId)))
                using (IUnitOfWork unitOfWork = new EfUnitOfWork(dbContext))
                {
                    var shoppingListRepository = new ShoppingListRepository(dbContext);
                    var shoppingList           = shoppingListRepository.FindByTitle("Shopping list to find", testDataKeys.UserId);
                    Assert.AreEqual(testDataKeys.Marker, shoppingList.Title);
                    Assert.AreEqual(testDataKeys.UserId, shoppingList.CreatorId.ToString());
                }
        }