Beispiel #1
0
 public DeleteShould() : base()
 {
     using (var repo = new SQLCarRepository(options))
     {
         repo.CreateCar(carToDelete);
     }
 }
Beispiel #2
0
        public void AddCarToTableReturn()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                var MadeCar = Repo.CreateCar(CarToCreate);

                MadeCar.Equals(ExpectedCar).ShouldBeTrue();
            }
        }
Beispiel #3
0
        public void GetCarByIdFromTable()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                Repo.CreateCar(CarToCreate);

                var GetCarById = Repo.GetCar(1);

                GetCarById.Equals(ExpectedCar).ShouldBeTrue();
            }
        }
Beispiel #4
0
        public void GetAllCarsFromTable()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                Repo.CreateCar(CarToCreate);

                var GetAllCars = Repo.GetAll();

                GetAllCars.Contains(ExpectedCar).ShouldBeTrue();
            }
        }
Beispiel #5
0
        public void UpdateCarReturnsUpdatedCar()
        {
            using (var repo = new SQLCarRepository(options))
            {
                repo.CreateCar(CarToCreate);
            }


            using (var Repo = new SQLCarRepository(options))
            {
                var UpdatedCar = Repo.UpdateCar(CarToUpdate);

                UpdatedCar.Equals(ExpectedCar).ShouldBeTrue();
            }
        }
Beispiel #6
0
        public void AddCarToTable()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                Repo.Cars.Count().ShouldBe(0);

                Repo.CreateCar(CarToCreate);
            }

            using (var Repo = new SQLCarRepository(options))
            {
                Repo.Cars.Count().ShouldBe(1);

                Repo.Cars.Single().Equals(ExpectedCar).ShouldBeTrue();
            }
        }
Beispiel #7
0
        public void UpdateCarInDB()
        {
            using (var repo = new SQLCarRepository(options))
            {
                repo.CreateCar(CarToCreate);
            }

            using (var repo = new SQLCarRepository(options))
            {
                repo.UpdateCar(CarToUpdate);
            }

            using (var repo = new SQLCarRepository(options))
            {
                repo.Cars.Single().Equals(ExpectedCar).ShouldBeTrue();
            }
        }