public void should_Get_By_Id() { var car = _testCarRepository.Get(_cars.First().Id); Assert.NotNull(car); Console.WriteLine(car); }
public void should_Delete_Exisitng_By_Id() { var car = _cars.First(); _testCarRepository.Delete(car.Id); _testCarRepository.SaveChanges(); _testCarRepository = new TestCarRepository(_context); var deletedCar = _testCarRepository.Get(car.Id); Assert.IsNull(deletedCar); }
public void should_Create_Or_Update_Exisitng() { var car = _cars.First(); car.Name = "GLE Benz"; _testCarRepository.CreateOrUpdate(car); _testCarRepository.SaveChanges(); _testCarRepository = new TestCarRepository(_context); var updatedCar = _testCarRepository.Get(car.Id); Assert.AreEqual("GLE Benz", updatedCar.Name); Console.WriteLine(updatedCar); }