public void WhenMechanicExists_DeleteMechanic_ItShouldDeleteSuccessfully() { Entities applicationContext = CreateTestEntities(); MechanicRepository testMechanicRepository = new MechanicRepository(applicationContext); int testMechanicId = 1; Mecanic testMechanic = applicationContext.Mecanics.FirstOrDefault(m => m.MecanicId == testMechanicId); testMechanicRepository.DeleteMechanic(testMechanicId); applicationContext.Mecanics.FirstOrDefault(m => m.MecanicId == testMechanicId).Should().BeNull(); }
public void DeleteMechanic(int mechanicId) { mechanicRepository.DeleteMechanic(mechanicId); }