public IHttpActionResult Post_DepositMoney([FromBody] double amount)
 {
     try
     {
         _bankingAccount.DepositMoney(User.Identity.Name, amount);
         return(Ok());
     }
     catch (Exception e)
     {
         return(InternalServerError(e));
     }
 }
Example #2
0
        public void Deposit_Money_Service_Autofac()
        {
            //Arrange
            _mockContextFactory.Setup(x => x.Create()).Returns(_mockContext.Object);

            //Act
            _bankingAccount.DepositMoney("*****@*****.**", 100);

            //Assert
            Assert.AreEqual(transactions.Count(), 4);
            Assert.AreEqual(transactions.Last().Amount, 100);
            Assert.AreEqual(transactions.Last().UserTo, "*****@*****.**");
        }