Add() 공개 메소드

Добавление курса в репозиторий
public Add ( ProductViewModel product ) : void
product ProductViewModel
리턴 void
예제 #1
0
 public void GetByIdTest()
 {
     IProductService _productService = new ProductService(new ProductRepository(), new AccountRepository(),
                                                          new PartnerRepository(), new ProductFilterFactory());
     ProductViewModel _productViewModel = GetProductViewModel();
     _productService.Add(_productViewModel);
     Assert.IsNotNull(_productService.GetById(1));
 }
예제 #2
0
 public void EditTest()
 {
     IProductService _productService = new ProductService(new ProductRepository(), new AccountRepository(),
                                                          new PartnerRepository(), new ProductFilterFactory());
     ProductViewModel _productViewModel = GetProductViewModel();
     _productService.Add(_productViewModel);
     _productViewModel.Description = "otherDescription";
     _productService.Edit(_productViewModel);
     bool actual, expected = true;
     if(_productService.GetById(1).Description.CompareTo("otherDisctiption") == 0)
     {
         actual = true;
     }
     else
     {
         actual = false;
     }
     Assert.AreEqual(expected, actual);
 }