Beispiel #1
0
        public void AccountIdSendTo_Not_Exist_In_Database_Should_Return_One_ErrorMessage()
        {
            TransactionTransferToAccountViewModel model = new TransactionTransferToAccountViewModel
            {
                AccountId       = 1,
                CustomerId      = 1,
                Balance         = 20000m,
                TransferAmount  = 15000m,
                AccountIdSendTo = 0
            };

            var errorcount = model.Validate(validationContext).Count();

            Assert.AreEqual(1, errorcount);
        }
Beispiel #2
0
        public void Transfer_Amount_Higher_Then_Balance_Should_Return_One_ErrorMessage()
        {
            TransactionTransferToAccountViewModel model = new TransactionTransferToAccountViewModel
            {
                AccountId       = 1,
                CustomerId      = 1,
                Balance         = 20000m,
                TransferAmount  = 210000m,
                AccountIdSendTo = 2
            };

            var errorcount = model.Validate(validationContext).Count();

            Assert.AreEqual(1, errorcount);
        }