public void Initialize() { _customerPacks = new List <CustomerPack> { UnitTestHelper.GenerateRandomData <CustomerPack>(x => { x.Id = CustomerPackId; x.CustomerId = CustomerId; }), UnitTestHelper.GenerateRandomData <CustomerPack>(), UnitTestHelper.GenerateRandomData <CustomerPack>(x => { x.CustomerId = CustomerId; }), UnitTestHelper.GenerateRandomData <CustomerPack>() }; _mockCustomerPackRepository = MockRepositoryHelper.Create(_customerPacks, (entity, id) => entity.Id == (int)id, (p1, p2) => p1.Id == p2.Id); _mockUnitOfWork = new Mock <IUnitOfWork>(); _target = new CustomerPackService(_mockCustomerPackRepository.Object, _mockUnitOfWork.Object); }
public ServiceDecompositionController(ICustomerService customerService, ICustomerPackService customerPackService, IDiagramService diagramService, IContributorService contributorService, ApplicationUserManager userManager, ApplicationRoleManager roleManager, IContextManager contextManager, IAppUserContext appUserContext) : base(contextManager) { if (customerService == null) { throw new ArgumentNullException(nameof(customerService)); } if (contextManager == null) { throw new ArgumentNullException(nameof(contextManager)); } if (appUserContext == null) { throw new ArgumentNullException(nameof(appUserContext)); } if (customerPackService == null) { throw new ArgumentNullException(nameof(customerPackService)); } if (diagramService == null) { throw new ArgumentNullException(nameof(diagramService)); } if (contributorService == null) { throw new ArgumentNullException(nameof(contributorService)); } if (userManager == null) { throw new ArgumentNullException(nameof(userManager)); } if (roleManager == null) { throw new ArgumentNullException(nameof(roleManager)); } _customerService = customerService; _customerPackService = customerPackService; _diagramService = diagramService; _contributorService = contributorService; _userManager = userManager; _roleManager = roleManager; _contextManager = contextManager; _appUserContext = appUserContext; }