Наследование: ICategoryService
Пример #1
0
 public void GetByIDTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryViewModel _categoryViewModel = GetCategoryViewModel();
     _categoryService.Add(_categoryViewModel);
     Assert.IsNotNull(_categoryService.GetByID(1));
 }
Пример #2
0
 public void EditTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryViewModel _categoryViewModel = GetCategoryViewModel();
     _categoryService.Add(_categoryViewModel);
     _categoryViewModel.Description = "otherDescription";
     _categoryService.Edit(_categoryViewModel);
     bool actual, expected = true;
     if(_categoryService.GetByID(1).Description.CompareTo("otherDescription") == 0)
     {
         actual = true;
     }
     else
     {
         actual = false;
     }
     Assert.AreEqual(expected, actual);
 }
Пример #3
0
 public void GetCategoryWithCategorysTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryViewModelForAddEditView actual = _categoryService.GetCategoryWithCategorys(null);
     Assert.IsNotNull(actual);
 }
Пример #4
0
 public void GetCategorysTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryCollectionViewModel actual = _categoryService.GetCategorys(1, 5);
     Assert.IsNotNull(actual);
 }