예제 #1
0
        public void ModelCar_Update_WithIdNotNull_True()
        {
            IService <ModelCar> modelCarService = new ModelCarService();
            ModelCar            newModelCar     = new ModelCar(1004, "Audi");

            modelCarService.Create(newModelCar);
            ModelCar crModelCar  = modelCarService.GetById(333);
            ModelCar modModelCar = new ModelCar(1004, "VW");

            modelCarService.Update(modModelCar);
            ModelCar updModelCar = modelCarService.GetById(1004);

            Assert.AreEqual(crModelCar.id, updModelCar.id);
            Assert.AreNotEqual(crModelCar.model, updModelCar.model);
        }
예제 #2
0
        public void ModelCar_GetById_IsIdNotExist_Null()
        {
            const int           id = 22220;
            IService <ModelCar> modelCarService = new ModelCarService();

            Assert.IsNull(modelCarService.GetById(id));
        }
예제 #3
0
        public void ModelCar_GetById_IsIdExist_Obj()
        {
            IService <ModelCar> modelCarService = new ModelCarService();
            ModelCar            newModelCar     = new ModelCar(1002, "First");

            modelCarService.Create(newModelCar);
            Assert.IsNotNull(modelCarService.GetById(newModelCar.id));
        }