Пример #1
0
        public void ModelCar_Create_WithIdNotNull_True()
        {
            IService <ModelCar> modelCarService = new ModelCarService();
            int      countBefore = modelCarService.GetListAll().Count;
            ModelCar newModelCar = new ModelCar(999, "Audi");

            modelCarService.Create(newModelCar);
            int countAfter = modelCarService.GetListAll().Count;

            Assert.AreNotEqual(countBefore, countAfter);
        }
Пример #2
0
        public void ModelCar_DeleteById_WithIdNotNull_True()
        {
            IService <ModelCar> modelCarService = new ModelCarService();
            ModelCar            newModelCar     = new ModelCar(1005, "Audi");

            modelCarService.Create(newModelCar);
            int countBefore = modelCarService.GetListAll().Count;

            modelCarService.DeleteById(1005);
            int countAfter = modelCarService.GetListAll().Count;

            Assert.IsTrue(countBefore > countAfter);
        }
Пример #3
0
        public void ModelCar_GetListAll_NotEmpty_ReturnCollection()
        {
            IService <ModelCar> modelCarService  = new ModelCarService();
            ModelCar            newModelCarFirst = new ModelCar(1001, "First");

            modelCarService.Create(newModelCarFirst);
            Assert.IsTrue(modelCarService.GetListAll().Count > 0);
        }