Add() public method

Добавление партнера в репозиторий
public Add ( PartnerViewModel partner ) : void
partner Courses.ViewModels.PartnerViewModel
return void
Exemplo n.º 1
0
 public void GetByIDTest()
 {
     IPartnerService _partnerService = new PatherService(new PartnerRepository(), new AccountRepository(), new PartnerFilterFactory());
     PartnerViewModel _partnerViewModel = GetPartnerViewModel();
     _partnerService.Add(_partnerViewModel);
     Assert.IsNotNull(_partnerService.GetByID(1));
 }
Exemplo n.º 2
0
 public void EditTest()
 {
     IPartnerService _partnerService = new PatherService(new PartnerRepository(), new AccountRepository(), new PartnerFilterFactory());
     PartnerViewModel _partnerViewModel = GetPartnerViewModel();
     _partnerService.Add(_partnerViewModel);
     _partnerViewModel.Address = "otherAddress";
     _partnerService.Edit(_partnerViewModel);
     bool actual, expected = true;
     if (_partnerService.GetByID(1).Address.CompareTo("otherAddress") == 0)
     {
         actual = true;
     }
     else
     {
         actual = false;
     }
     Assert.AreEqual(expected, actual);
 }