コード例 #1
0
        public void TestBlueSky_EditAccount()
        {
            //set-up
            IAccountService service = MockAccountService.Singleton;

            CreateAccountData();
            AccountModel                = new AccountModel();
            AccountModel.RecordId       = 1;
            AccountModel.AccountBalance = 100m;
            AccountModel.CompanyName    = "test";
            AccountModel.InterestRate   = 2m;

            IAccount account = service.GetAccount(1);

            //pre-conditions
            Assert.AreNotEqual(account.AccountBalance, AccountModel.AccountBalance);
            Assert.AreNotEqual(account.CompanyName, AccountModel.CompanyName);
            Assert.AreNotEqual(account.InterestRate, AccountModel.InterestRate);
            Assert.AreEqual(account.RecordId, AccountModel.RecordId);

            //exercise
            Presenter.EditAccount(AccountModel);

            //post-conditions
            Assert.AreEqual(account.AccountBalance, AccountModel.AccountBalance);
            Assert.AreEqual(account.CompanyName, AccountModel.CompanyName);
            Assert.AreEqual(account.InterestRate, AccountModel.InterestRate);
            Assert.AreEqual(account.RecordId, AccountModel.RecordId);
        }