public void GetAutoByIdTest() { TestEnvironmentHelper.InitializeTestData(); AutoReservationService service = new AutoReservationService(); IList<AutoDto> autos = service.Autos; AutoDto first = autos[0]; int id = first.Id; AutoDto autoById = service.GetAutoById(id); Assert.AreEqual(first, autoById); }
public void DeleteAutoTest() { TestEnvironmentHelper.InitializeTestData(); AutoReservationService service = new AutoReservationService(); int count = service.Autos.Count; AutoDto delete = service.Autos[0]; int id = delete.Id; service.DeleteAuto(delete); Assert.AreEqual(count - 1, service.Autos.Count); Assert.IsNull(service.GetAutoById(id)); }