Ejemplo n.º 1
0
        private void CreateNewElectric()
        {
            Console.Clear();
            Electric newElectric = new Electric();

            Console.WriteLine("Enter the Make");
            newElectric.Make = Console.ReadLine();
            Console.WriteLine("Enter the Model");
            newElectric.Model = Console.ReadLine();
            Console.WriteLine("Enter fuel efficiency information");
            newElectric.FuelEfficiency = Console.ReadLine();
            electric_Repo.AddElectricToList(newElectric);
        }
Ejemplo n.º 2
0
        //create
        public void AddElectricToList_ShouldGetCorrectBoolean()
        {
            //Arrange
            Electric      electric = new Electric();
            Electric_Repo repo     = new Electric_Repo();
            //Act
            bool addResult = repo.AddElectricToList(electric);

            //Assert
            Assert.IsTrue(addResult);
        }
Ejemplo n.º 3
0
        //read
        public void GetElectricList_ShouldReturnCorrectCollection()
        {
            //arrange
            Electric      electric = new Electric();
            Electric_Repo repo     = new Electric_Repo();

            repo.AddElectricToList(electric);
            //act
            List <Electric> electricList   = repo.GetElectricList();
            bool            dirHasElectric = electricList.Contains(electric);

            //assert
            Assert.IsTrue(dirHasElectric);
        }
Ejemplo n.º 4
0
 public void Arrange()
 {
     _repo     = new Electric_Repo();
     _electric = new Electric("Tesla", "Model 3", "30kWh/100mi");
     _repo.AddElectricToList(_electric);
 }