public ProductService(ProductRepository repository) { if (repository == null) { throw new ArgumentNullException("repository"); } this.repository = repository; }
public void CreateWithNullContractMapperWillThrow(ProductRepository repository) { // Fixture setup IContractMapper nullMapper = null; // Exercise system and verify outcome Assert.Throws<ArgumentNullException>(() => new ProductManagementService(repository, nullMapper)); // Teardown }
public HomeController(ProductRepository repository) { if (repository == null) { throw new ArgumentNullException("repository"); } this.repository = repository; }
public CommerceControllerFactory(ProductRepository repository) { if (repository == null) { throw new ArgumentNullException("repository"); } this.controllerMap = new Dictionary<string, Func<RequestContext, IController>>(); this.controllerMap["Account"] = ctx => new AccountController(); this.controllerMap["Home"] = ctx => new HomeController(repository); }
public HomeController(ProductRepository repository, CurrencyProvider currencyProvider) { if (repository == null) { throw new ArgumentNullException("repository"); } if (currencyProvider == null) { throw new ArgumentNullException("currencyProvider"); } this.repository = repository; this.currencyProvider = currencyProvider; }
public ProductManagementService(ProductRepository repository, IContractMapper mapper) { if (repository == null) { throw new ArgumentNullException("repository"); } if (mapper == null) { throw new ArgumentNullException("mapper"); } this.repository = repository; this.mapper = mapper; }
public AuditingProductRepository( ProductRepository repository, IAuditor auditor) { if (repository == null) { throw new ArgumentNullException("repository"); } if (auditor == null) { throw new ArgumentNullException("auditor"); } this.innerRepository = repository; this.auditor = auditor; }