public void CanHandleNewBudgets() { IRepository <Client> clientRepository = new LocalRepository <Client>(); IRepository <Budget> budgetRepository = new LocalRepository <Budget>(); var userManager = new Mock <IIdentityMembershipProvider>(); Budget budget1 = new Budget { Id = 1, ClientId = 1, IsHandled = false }; Budget budget2 = new Budget { Id = 2, ClientId = 1, IsHandled = false }; budgetRepository.Add(budget1); budgetRepository.Add(budget2); Assert.AreEqual(2, budgetRepository.All().Count()); var controller = new BudgetController(clientRepository, budgetRepository, userManager.Object); var result = controller.Handle(1); Assert.AreEqual(true, budgetRepository.Where(b => b.Id == budget1.Id).Single().IsHandled); Assert.AreEqual(false, budgetRepository.Where(b => b.Id == budget2.Id).Single().IsHandled); }