Ejemplo n.º 1
0
        public void should_Get_By_Id()
        {
            var car = _testCarRepository.Get(_cars.First().Id);

            Assert.NotNull(car);
            Console.WriteLine(car);
        }
Ejemplo n.º 2
0
        public void should_Delete_Exisitng_By_Id()
        {
            var car = _cars.First();

            _testCarRepository.Delete(car.Id);
            _testCarRepository.SaveChanges();

            _testCarRepository = new TestCarRepository(_context);

            var deletedCar = _testCarRepository.Get(car.Id);

            Assert.IsNull(deletedCar);
        }
Ejemplo n.º 3
0
        public void should_Create_Or_Update_Exisitng()
        {
            var car = _cars.First();

            car.Name = "GLE Benz";
            _testCarRepository.CreateOrUpdate(car);
            _testCarRepository.SaveChanges();

            _testCarRepository = new TestCarRepository(_context);

            var updatedCar = _testCarRepository.Get(car.Id);

            Assert.AreEqual("GLE Benz", updatedCar.Name);
            Console.WriteLine(updatedCar);
        }