Example #1
0
        private void CreateNewGas()
        {
            Console.Clear();
            Gas newGas = new Gas();

            Console.WriteLine("Enter the Make");
            newGas.Make = Console.ReadLine();
            Console.WriteLine("Enter the Model");
            newGas.Model = Console.ReadLine();
            Console.WriteLine("Enter fuel efficiency information");
            newGas.FuelEfficiency = Console.ReadLine();
            gas_Repo.AddGasToList(newGas);
        }
Example #2
0
        //create
        public void AddGasToList_ShouldGetCorrectBoolean()
        {
            //Arrange
            Gas      gas  = new Gas();
            Gas_Repo repo = new Gas_Repo();
            //Act
            bool addResult = repo.AddGasToList(gas);

            //Assert
            Assert.IsTrue(addResult);
        }
Example #3
0
        //read
        public void GetGasList_ShouldReturnCorrectCollection()
        {
            //arrange
            Gas      gas  = new Gas();
            Gas_Repo repo = new Gas_Repo();

            repo.AddGasToList(gas);
            //act
            List <Gas> gasList   = repo.GetGasList();
            bool       dirHasGas = gasList.Contains(gas);

            //assert
            Assert.IsTrue(dirHasGas);
        }
Example #4
0
 public void Arrange()
 {
     _repo = new Gas_Repo();
     _gas  = new Gas("GMC", "Sierra", "17 miles per gallon");
     _repo.AddGasToList(_gas);
 }