Exemplo n.º 1
0
 public void DepositIntegrationTest()
 {
     ba = new BankAccount02(new ConsoleLog())
     {
         Balance = 100
     };
     ba.Deposit(100);
     Assert.That(ba.Balance, Is.EqualTo(200));
 }
Exemplo n.º 2
0
        public void DepositTestStub()
        {
            var log = new NullLogWithResult(true);

            ba = new BankAccount02(log)
            {
                Balance = 100
            };
            ba.Deposit(100);
            Assert.That(ba.Balance, Is.EqualTo(200));
        }
Exemplo n.º 3
0
        public void DepositTestWithMock()
        {
            var log = new LogMock(true);

            ba = new BankAccount02(log)
            {
                Balance = 100
            };
            ba.Deposit(100);
            Assert.Multiple(() =>
            {
                Assert.That(ba.Balance, Is.EqualTo(200));
                Assert.That(
                    log.MethodCallCount[nameof(LogMock.Write)], Is.EqualTo(1));
            });
        }