Exemplo n.º 1
0
        public void TransferMinFundsFailAll([Values(190, 345)] int a, [Values(0, 20)] int b, [Values(346, 500)] int c)
        {
            Account source = new Account();

            source.Deposit(a);
            Account destination = new Account();

            destination.Deposit(b);

            Assert.That(() => destination = source.TransferMinFunds(destination, c), Throws.TypeOf <NotEnoughFundsException>());
        }
Exemplo n.º 2
0
        public void TransferMinFundsFail(int a, int b, int c)
        {
            Account source = new Account();

            source.Deposit(a);
            Account destination = new Account();

            destination.Deposit(b);

            Assert.That(() => destination = source.TransferMinFunds(destination, c), Throws.TypeOf <NotEnoughFundsException>());
        }
Exemplo n.º 3
0
        public void TransferMinFundsFail(int a, int b, int c)
        {
            Account source = new Account();

            source.Deposit(a);
            Account destination = new Account();

            destination.Deposit(b);

            destination = source.TransferMinFunds(destination, c);
        }
Exemplo n.º 4
0
        public void TransferMinFundsFailAll([Values(200, 500)] int a, [Values(0, 20)] int b,
                                            [Values(140, 120)] int c)
        {
            Account source = new Account();

            source.Deposite(a);
            Account destination = new Account();

            destination.Deposite(b);
            destination = source.TransferMinFunds(destination, c);
        }
Exemplo n.º 5
0
        public void ExpectedExceptionTest(int a, int b, int c)
        {
            Assert.Throws <NotEnoughFundsException>(delegate()
            {
                Account source = new Account();
                source.Deposit(a);
                Account destination = new Account();
                destination.Deposit(b);

                destination = source.TransferMinFunds(destination, c);
            });
        }
Exemplo n.º 6
0
        public void TransferMinFunds(int a, int b, int c)
        {
            Account source = new Account();

            source.Deposit(a);
            Account destination = new Account();

            destination.Deposit(b);

            source.TransferMinFunds(destination, c);
            Assert.AreEqual(c, destination.Balance);
        }