Ejemplo n.º 1
0
 public DeleteShould() : base()
 {
     using (var repo = new SQLCarRepository(options))
     {
         repo.CreateCar(carToDelete);
     }
 }
Ejemplo n.º 2
0
        public void GetCarByIdNotFound()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                var GetCarById = Repo.GetCar(99);

                GetCarById.ShouldBeNull();
            }
        }
Ejemplo n.º 3
0
        public void AddCarToTableReturn()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                var MadeCar = Repo.CreateCar(CarToCreate);

                MadeCar.Equals(ExpectedCar).ShouldBeTrue();
            }
        }
Ejemplo n.º 4
0
        public void GetCarByIdFromTable()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                Repo.CreateCar(CarToCreate);

                var GetCarById = Repo.GetCar(1);

                GetCarById.Equals(ExpectedCar).ShouldBeTrue();
            }
        }
Ejemplo n.º 5
0
        public void GetAllCarsFromTable()
        {
            using (var Repo = new SQLCarRepository(options))
            {
                Repo.CreateCar(CarToCreate);

                var GetAllCars = Repo.GetAll();

                GetAllCars.Contains(ExpectedCar).ShouldBeTrue();
            }
        }
Ejemplo n.º 6
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();
            }
        }
Ejemplo n.º 7
0
        public void RemoveCarFromDb()
        {
            using (var repo = new SQLCarRepository(options))
            {
                repo.Cars.Count().ShouldBe(1);

                repo.DeleteCar(1);
            }

            using (var repo = new SQLCarRepository(options))
            {
                repo.Cars.Count().ShouldBe(0);

                repo.Cars.Contains(carToDelete).ShouldBeFalse();
            }
        }
Ejemplo n.º 8
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();
            }
        }
Ejemplo n.º 9
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();
            }
        }