Example #1
0
            public void Should_KeepListsSynchronized_After_RemovingAnAccount()
            {
                ViewModel = new ManageAccountsViewModel(AccountManager);

                var account = new Account("TestAccount");

                ViewModel.AddAccount(account);

                ViewModel.RemoveAccount(ViewModel.Accounts[0]);

                Assert.AreEqual(0, ViewModel.AccountManager.Accounts.Count);
                Assert.AreEqual(0, ViewModel.Accounts.Count);
            }
Example #2
0
            public void Should_Keep_Lists_Synchronized()
            {
                ViewModel = new ManageAccountsViewModel(AccountManager);

                int beforeCount = ViewModel.AccountManager.Accounts.Count;

                Assert.AreEqual(beforeCount, ViewModel.Accounts.Count);

                ViewModel.AddAccount(new Account("TestAccount"));

                int afterCount = ViewModel.AccountManager.Accounts.Count;

                Assert.AreEqual(beforeCount + 1, afterCount);
                Assert.AreEqual(afterCount, ViewModel.Accounts.Count);
            }