Example #1
0
        public void ShouldGetSellerStockWithotStocks()
        {
            Client client = new Client()
            {
                FirstName   = "Moon",
                LastName    = "Pilot",
                Balance     = 1000,
                PhoneNumber = "765899",
                Stocks      = new List <Stock>()
            };
            Stock stock = bussinesService.GetSellerStock(client);

            Assert.AreEqual(null, stock);
        }
Example #2
0
        public void Run(int number)
        {
            Random rnd = new Random();

            IsContinue = true;
            while (IsContinue)
            {
                Client seller       = bussinesService.GetClient(rnd.Next(1, number));
                Client buyer        = bussinesService.GetClient(rnd.Next(1, number));
                Stock  stockForSale = bussinesService.GetSellerStock(seller);
                if (stockForSale != null)
                {
                    MakeTrade(seller, buyer, stockForSale);
                }

                System.Threading.Thread.Sleep(10000);
            }
        }