public void RegisterTransactionTest()
        {
            var portfolio = new Portfolio()
            {
                Id               = 1,
                TotalMoney       = 1000000,
                AvailableMoney   = 100000,
                AvailableActions = new List <Actions>()
                {
                    new Actions()
                    {
                        Id = 1,
                        QuantityOfActions = 1000,
                        StockId           = 1,
                        PortfolioId       = 1
                    }
                },
                Transactions = new List <Transaction>()
            };
            //Arrange
            var mockUnitOfWork = new Mock <IUnitOfWork>();

            mockUnitOfWork.Setup(un => un.PortfolioRepository.Get(It.IsAny <Expression <Func <Portfolio, bool> > >(), null, It.IsAny <string>()))
            .Returns(new List <Portfolio>()
            {
                portfolio
            });
            mockUnitOfWork.Setup(un => un.StockRepository.GetById(It.IsAny <long>())).Returns(new Stock
            {
                Id               = 1,
                Code             = "GOO",
                Description      = "GooGoo",
                Name             = "GOO",
                QuantiyOfActions = 10000,
                UnityValue       = 1.67
            });
            mockUnitOfWork.Setup(un => un.TransactionRepository.Insert(It.IsAny <Transaction>()));
            mockUnitOfWork.Setup(un => un.PortfolioRepository.GetById(It.IsAny <long>())).Returns(portfolio);
            mockUnitOfWork.Setup(un => un.PortfolioRepository.Update(It.IsAny <Portfolio>()));
            mockUnitOfWork.Setup(un => un.Save());

            ITransactionLogic transactionLogic = new TransactionLogic(mockUnitOfWork.Object);
            var transaction = new Transaction()
            {
                Id            = 1,
                Portfolio     = portfolio,
                StockId       = 1,
                StockQuantity = 20
            };
            var response = transactionLogic.RegisterTransaction(transaction);

            Assert.True(response);
        }