コード例 #1
0
        public void ValidateReturnsSuccessfulOperation()
        {
            Account origin = new Account()
            {
                Funds = 7
            };
            Account destination = new Account()
            {
                Funds = 0
            };
            decimal amountToTransfer = 5m;

            var services = new WireTransferValidator();

            var result = services.Validate(origin, destination, amountToTransfer);

            Assert.IsTrue(result.IsSuccessful);
        }
コード例 #2
0
        public void ValidateReturnErrorWhenInsufficientsFunds()
        {
            Account origin = new Account()
            {
                Funds = 0
            };
            Account destination = new Account()
            {
                Funds = 0
            };

            decimal amountToTranfer = 5;
            var     service         = new WireTransferValidator();

            var result = service.validate(origin, destination, amountToTranfer);

            Assert.IsFalse(result.IsSuccessful);
            Assert.AreEqual("El origen de la cuenta no tiene dinero disponible", result.ErrorMessage);
        }
コード例 #3
0
        public void ValidateReturnsErrorWhenInsufficientFunds()
        {
            Account origin = new Account()
            {
                Funds = 0
            };
            Account destination = new Account()
            {
                Funds = 0
            };
            decimal amountToTransfer = 5m;

            var services = new WireTransferValidator();

            var result = services.Validate(origin, destination, amountToTransfer);

            Assert.IsFalse(result.IsSuccessful);
            Assert.AreEqual("The origin account does not have enough funds available", result.ErrorMessage);
        }
コード例 #4
0
        public void ValidatorReturnsSuccessfulOperationWithSufficientFunds()
        {
            //Preparation
            Account origin = new Account()
            {
                Funds = 7
            };
            Account destination = new Account()
            {
                Funds = 0
            };
            decimal amountToTransfer = 5m;

            //Testing
            var service = new WireTransferValidator();
            var result  = service.Validate(origin, destination, amountToTransfer);

            //Verification
            Assert.IsTrue(result.IsSuccessful);
        }