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();
        }
Beispiel #3
0
 private static void GetPetNameByCarId()
 {
     while (true)
     {
         TryConnectTo(CarsDb);
         if (!FindId("Enter CarId: ", "Inventory", out _carId))
         {
             continue;
         }
         _petName = CarsDb.GetPetNameProcedure(_carId);
         CarsDb.CloseConnection();
         var okMessage = string.Format("PetName is: '{0}'", _petName);
         PrintColored(okMessage, OkForegroungColor);
         break;
     }
 }