public void should_update_sale_record_return()
        {
            var userId = TestData.GenerateRandomInt();

            var company = TestData.GenerateRandomString();

            var symbol = TestData.GenerateRandomString();

            var quantity = 70;

            var session = Substitute.For <ISession>();

            _dbSessionService.OpenSession().Returns(session);

            _stockQueryService.QueryStocks(Arg.Any <ISession>(), Arg.Any <int>(), Arg.Any <string>())
            .Returns(new List <Stock>
            {
                new Stock
                {
                    UserId   = userId,
                    Symbol   = symbol,
                    Quantity = 28
                }
            });

            _sut.CreateSaleRecord(userId, company, symbol, quantity);
        }
        public void should_add_deposit_record_return()
        {
            var userId = TestData.GenerateRandomInt();

            var exchange = TestData.GenerateRandomString();

            var deposit = 1000.23m;

            var quantity = 50;

            var session = Substitute.For <ISession>();

            _dbSessionService.OpenSession().Returns(session);

            _sut.AddDeposit(userId, exchange, deposit, quantity);
        }
        public void should_create_sale_record_return()
        {
            var userId = TestData.GenerateRandomInt();

            var company = TestData.GenerateRandomString();

            var symbol = TestData.GenerateRandomString();

            var quantity = 70;

            var session = Substitute.For <ISession>();

            _dbSessionService.OpenSession().Returns(session);

            _sut.CreateSaleRecord(userId, company, symbol, quantity);
        }
Ejemplo n.º 4
0
        public void should_add_withdrawal_record_return()
        {
            var userId = TestData.GenerateRandomInt();

            var exchange = TestData.GenerateRandomString();

            var withdrawal = 800.65m;

            var quantity = 20;

            var session = Substitute.For <ISession>();

            _dbSessionService.OpenSession().Returns(session);

            _sut.AddWithdrawal(userId, exchange, withdrawal, quantity);
        }