public void DeleteAutoFromInventoryTable() { var cars = new CarsDb(); cars.OpenConnection(ConnectionString); var carId = InsertTestAutoInTheInventoryTable(cars); cars.DeleteAuto(carId); Assert.IsFalse(cars.IsPresentId("Inventory", carId)); cars.CloseConnection(); }
public void GetPetNameProcedure() { var cars = new CarsDb(); cars.OpenConnection(ConnectionString); var carId = InsertTestAutoInTheInventoryTable(cars); var petName = cars.GetPetNameProcedure(carId); Assert.AreEqual("p", petName); cars.DeleteAuto(carId); cars.CloseConnection(); }
public void UpdateAutoPetName() { var cars = new CarsDb(); cars.OpenConnection(ConnectionString); var carId = InsertTestAutoInTheInventoryTable(cars); const string expectedPetName = "p2"; cars.UpdateAutoPetName(carId, expectedPetName); var petName = cars.GetPetNameProcedure(carId); Assert.AreEqual(expectedPetName, petName); cars.DeleteAuto(carId); cars.CloseConnection(); }
private static void DeleteAuto() { while (true) { TryConnectTo(CarsDb); if (!FindId("Enter CarId: ", "Inventory", out _carId)) { continue; } CarsDb.DeleteAuto(_carId); CarsDb.CloseConnection(); var okMessage = string.Format("Car with id {0} deleted", _carId); PrintColored(okMessage, OkForegroungColor); break; } }