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); }
//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); }
//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); }
public void Arrange() { _repo = new Electric_Repo(); _electric = new Electric("Tesla", "Model 3", "30kWh/100mi"); _repo.AddElectricToList(_electric); }