Example #1
0
        public void Send_Money_Service_Autofac()
        {
            //Arrange
            _mockContextFactory.Setup(x => x.Create()).Returns(_mockContext.Object);


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

            //Assert
            Assert.AreEqual(transactions.Count(), 4);
            Assert.AreEqual(transactions.Last().Amount, 100);
            Assert.AreEqual(transactions.Last().UserFrom, "*****@*****.**");
            Assert.AreEqual(transactions.Last().UserTo, "*****@*****.**");
        }
 public IHttpActionResult Post_SendMoney(TransferToUserModelView model)
 {
     try
     {
         _bankingAccount.SendMoney(User.Identity.Name, model.UserName, model.Amount, model.Message);
         return(Ok());
     }
     catch (Exception e)
     {
         return(InternalServerError(e));
     }
 }