Ejemplo n.º 1
0
        public void DispenseCans()
        {
            Cola       Cola     = new Cola();//Need to change names. Similarity to class is confusing.
            RootBeer   RootBeer = new RootBeer();
            OrangeSoda Orange   = new OrangeSoda();

            for (int index = 0; index < 50; index++)
            {
                List <Coin> Coin = new List <Coin>();
                register.Add("Cola");
                Console.WriteLine(index);
                int balanceOfCola = index;
            }

            for (int index = 0; index < 50; index++)
            {
                List <Coin> Coin = new List <Coin>(); //List<string> register = new List<string>();
                register.Add("Root Beer");            //How do spaces in list names affect the system?
                Console.WriteLine(index);
                int balanceOfRootBeer = index;
            }

            for (int index = 0; index < 50; index++)
            {
                List <Coin> Coin = new List <Coin>();
                register.Add("Orange");
                Console.WriteLine(index);
                int balanceOfOrange = index;
            }
            Console.WriteLine();
        }
Ejemplo n.º 2
0
        public void DetermineAmountOfChange_CaculateChangeToReturn_AmountOfChangeIs15Cents()
        {
            //Arrange - objects, variables, etc.
            SodaMachine soda       = new SodaMachine();
            Can         orangeSoda = new OrangeSoda();
            double      payment    = 0.25;

            double expected = 0.19;
            double actual;

            //Act
            actual = soda.DetermineAmountOfChange(orangeSoda, payment);
            //Assert
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void PrepareCan_CheckToSeeIfSelectedCanIsAvailable_ReturnColaIfAvailable()
        {
            // Arrange
            SodaMachine soda       = new SodaMachine();
            Can         cola       = new Cola();
            Can         orangeSoda = new OrangeSoda();
            Can         newCan;

            string expected = cola.name;
            string actual;

            // Act
            newCan = soda.PrepareCan("Cola");
            actual = newCan.name;

            // Assert
            Assert.AreEqual(expected, actual);
        }