Inheritance: ICategoryService
Ejemplo n.º 1
0
 public void GetByIDTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryViewModel _categoryViewModel = GetCategoryViewModel();
     _categoryService.Add(_categoryViewModel);
     Assert.IsNotNull(_categoryService.GetByID(1));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 public void GetCategoryWithCategorysTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryViewModelForAddEditView actual = _categoryService.GetCategoryWithCategorys(null);
     Assert.IsNotNull(actual);
 }
Ejemplo n.º 4
0
 public void GetCategorysTest()
 {
     ICategoryService _categoryService = new CategoryService(new CategoryRepository(), new CategoryFilterFactory());
     CategoryCollectionViewModel actual = _categoryService.GetCategorys(1, 5);
     Assert.IsNotNull(actual);
 }