Beispiel #1
0
        private void GetListOfElectric()
        {
            Console.Clear();
            List <Electric> listOfElectric = electric_Repo.GetElectricList();

            foreach (Electric electric in listOfElectric)
            {
                Console.WriteLine($"\nMake: {electric.Make}\n" +
                                  $"Model: {electric.Model}\n" +
                                  $"Fuel Efficiency: {electric.FuelEfficiency}");
            }
        }
        //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);
        }