Exemplo n.º 1
0
        public void JSONCustomerRepository_DeleteEntity_Test()
        {
            //Arrange
            var customerRepo = new JSONBaseRepository <Customer>(@"D:\Projects\OOP Principles\VehicleShowRoom\VehicleIndustry.Dal\JSONdatabase\Tests\customers_tests.json");
            var customers    = customerRepo.GetAll().ToList();
            var toDelete     = customers[0];

            //Act
            customerRepo.DeleteById(toDelete.Id.ToString());
            //Assert
            Assert.True(customerRepo.GetById(toDelete.Id.ToString()) == null);
        }
Exemplo n.º 2
0
        public void JSONGearboxRepository_DeleteEntity_Test()
        {
            //Arrange
            var gearboxRepo = new JSONBaseRepository <GearBox>(@"D:\Projects\OOP Principles\VehicleShowRoom\VehicleIndustry.Dal\JSONdatabase\Tests\gearboxes_tests.json");

            var gearboxes = gearboxRepo.GetAll().ToList();
            var toDelete  = gearboxes[0];

            //Act
            gearboxRepo.DeleteById(toDelete.Id.ToString());
            //Assert
            Assert.True(gearboxRepo.GetById(toDelete.Id.ToString()) == null);
        }