Esempio n. 1
0
        public void GetGasList_ShouldWork()
        {
            GasRepo testRepo = new GasRepo();

            List <GasClass> _listOfGased = testRepo.GetGasList();

            Console.WriteLine(_listOfGased);
        }
Esempio n. 2
0
        public void AddGasToList_ShouldWork()
        {
            GasRepo  testRepo = new GasRepo();
            GasClass newGas   = new GasClass {
                Make = "Mitsubishi", Model = "Lancer", Year = 4, Price = 2, Miles = 1
            };
            List <GasClass> _listOfGased = new List <GasClass>();

            // Act
            _listOfGased.Add(newGas);

            // Assert
            Assert.IsTrue(_listOfGased.Count > 0);
        }
Esempio n. 3
0
        public void RemoveGasFromList_ShouldWork()
        {
            GasRepo  testRepo = new GasRepo();
            GasClass newGas   = new GasClass {
                Make = "Mitsubishi", Model = "Lancer", Year = 4, Price = 2, Miles = 1
            };
            List <GasClass> _listOfGased = new List <GasClass>();

            _listOfGased.Add(newGas);

            int initialGas = _listOfGased.Count;

            _listOfGased.Remove(newGas);

            if (initialGas > _listOfGased.Count)
            {
                Console.WriteLine("true");
            }
            else
            {
                Console.WriteLine("false");
            }
        }