Ejemplo n.º 1
0
        private static void Play()
        {
            Console.WriteLine("Please deposit money you would like to play with: ");
            var deposit = Int32.Parse(Console.ReadLine());

            var stake = 0;

            do
            {
                Console.WriteLine("\r\nEnter stake amount: ");
                stake = Int32.Parse(Console.ReadLine());
                BedeSlotMachine bede       = new BedeSlotMachine();
                var             spinResult = bede.SpinBedeSlotMachine();
                var             amountWon  = bede.CalculateWinnings(spinResult, deposit, stake);

                int rowCount    = spinResult.Count;
                int columnCount = spinResult.First().Count;

                for (int i = 0; i < columnCount; i++)
                {
                    for (int j = 0; j < rowCount; j++)
                    {
                        Console.Write(spinResult[j][i].Name + " ");
                    }
                    Console.WriteLine();
                }

                Console.WriteLine("\r\nYou have won: " + amountWon.AmountWon);
                Console.WriteLine("\r\nYour current balance is: " + amountWon.CurrentBalance);
            }while (stake > deposit || deposit != 0);
        }
Ejemplo n.º 2
0
        public void CalculateHasCorrectRowsInData()
        {
            //Arrange
            var spinResult = _Bede.SpinBedeSlotMachine();
            var stake      = 5;
            var deposit    = 1000;
            var rows       = 4;

            //Act
            var result = _Bede.CalculateWinnings(spinResult, deposit, stake);

            //Assert
            NUnit.Framework.Assert.That(spinResult.Count, Is.EqualTo(rows));
        }