public void LockUser() { IList <UserAccount> accounts = new List <UserAccount>(); NMock.Actions.InvokeAction saveUser = new NMock.Actions.InvokeAction(new Action(() => accounts.Add(userAccount))); accountAdministrationDaoMock.Expects.Any.MethodWith(x => x.SaveOrUpdateUser(userAccount)).Will(saveUser); accountAdministrationServiceMock.Expects.Any.MethodWith(x => x.SaveOrUpdateUser(userAccount)).Will(saveUser); userInformationServiceMock.Expects.Any.MethodWith(x => x.GetUserAccountById(userAccount.Id)).WillReturn(userAccount); userInformationDaoMock.Expects.Any.MethodWith(x => x.GetUserAccountById(userAccount.Id)).WillReturn(userAccount); managementService.LockUser(userAccountId); UserAccount userAccount2 = userInformationService.GetUserAccountById(userAccountId); Assert.AreEqual(userAccount2.AccountStatus, SpringMvc.Models.POCO.UserAccount.Status.LOCKED_OUT); }