public void TestEndLoadAccounts() { //Given WCFAccountService accountService = _mocks.StrictMock <WCFAccountService>(); IAsyncResult result = _mocks.Stub <IAsyncResult>(); CustomerViewModel vm = new CustomerViewModel(); vm.AccountService = accountService; //mock the collection returned by ThirdPartyService AccountDto account = new AccountDto { Balance = 100, BalanceDate = DateTime.Now, Id = 1, Title = "Account 1", Number = "123" }; List <AccountDto> accounts = new List <AccountDto>(); accounts.Add(account); Expect.Call(accountService.EndGetAccountsByCustomer(result)).Return(accounts); _mocks.ReplayAll(); //When vm.EndLoadAccounts(result); Assert.IsFalse(vm.InProgress); Assert.Equals(vm.Accounts.Count, accounts.Count); }
public void TestEndLoadAccounts() { //Given WCFAccountService accountService = _mocks.StrictMock<WCFAccountService>(); IAsyncResult result = _mocks.Stub<IAsyncResult>(); CustomerViewModel vm = new CustomerViewModel(); vm.AccountService = accountService; //mock the collection returned by ThirdPartyService AccountDto account = new AccountDto { Balance = 100, BalanceDate = DateTime.Now, Id = 1, Title = "Account 1", Number = "123" }; List<AccountDto> accounts = new List<AccountDto>(); accounts.Add(account); Expect.Call(accountService.EndGetAccountsByCustomer(result)).Return(accounts); _mocks.ReplayAll(); //When vm.EndLoadAccounts(result); Assert.IsFalse(vm.InProgress); Assert.Equals(vm.Accounts.Count, accounts.Count); }