/// <summary> /// Initializes a new instance of <see cref="GameController"/> class. /// </summary> public GameController(ISeeBattleGameService seeBattleGameService, IApplicationMapper applicationMapper, IContractMapper contractMapper) { //TODO Transfer mappers to ready-made libraries like AatoMapper _seeBattleGameService = seeBattleGameService.NotNull(nameof(seeBattleGameService)); _applicationMapper = applicationMapper.NotNull(nameof(applicationMapper)); _contractMapper = contractMapper.NotNull(nameof(contractMapper)); }
public LifetimeManagingCommerceServiceContainer() { this.connectionString = ConfigurationManager.ConnectionStrings ["CommerceObjectContext"].ConnectionString; this.mapper = new ContractMapper(); }
public LifetimeManagingCommerceServiceContainer() { this.connectionString = ConfigurationManager.ConnectionStrings ["CommerceObjectContext"].ConnectionString; this.mapper = new ContractMapper(); }
public void CreateWithNullProductRepositoryWillThrow(IContractMapper mapper) { // Fixture setup ProductRepository nullRepository = null; // Exercise system and verify outcome Assert.Throws<ArgumentNullException>(() => new ProductManagementService(nullRepository, mapper)); // Teardown }
public PooledContainer() { // Configured as singleton, since the same mapper is used for all // XferProductRepositories involved this.mapper = new ContractMapper(); this.free = new List <XferProductRepository>(); this.used = new List <XferProductRepository>(); syncRoot = new object(); }
public void MapperIsCorrect([Frozen] IContractMapper expectedMapper, ProductManagementService sut) { // Fixture setup // Exercise system IContractMapper result = sut.Mapper; // Verify outcome Assert.Equal(expectedMapper, result); // Teardown }
public void CreateWithNullContractMapperWillThrow(ProductRepository repository) { // Fixture setup IContractMapper nullMapper = null; // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => new ProductManagementService(repository, nullMapper)); // Teardown }
public void CreateWithNullProductRepositoryWillThrow(IContractMapper mapper) { // Fixture setup ProductRepository nullRepository = null; // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => new ProductManagementService(nullRepository, mapper)); // Teardown }
public ReleasingCommerceServiceContainer() { this.connectionString = ConfigurationManager.ConnectionStrings ["CommerceObjectContext"].ConnectionString; this.mapper = new ContractMapper(); this.syncRoot = new object(); this.repositories = new Dictionary <IProductManagementService, SqlProductRepository>(); }
public ReleasingCommerceServiceContainer() { this.connectionString = ConfigurationManager.ConnectionStrings ["CommerceObjectContext"].ConnectionString; this.mapper = new ContractMapper(); this.syncRoot = new object(); this.repositories = new Dictionary<IProductManagementService, SqlProductRepository>(); }
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 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 PooledContainer() { this.mapper = new ContractMapper(); this.free = new List <XferProductRepository>(); this.used = new List <XferProductRepository>(); }
public PooledContainer() { this.mapper = new ContractMapper(); this.free = new List<XferProductRepository>(); this.used = new List<XferProductRepository>(); }
public SingletonContainer() { // creates singletons repository = new InMemoryProductRepository(); mapper = new ContractMapper(); }
public ContractFinderConroller(ILogger <ContractFinderConroller> logger, IRepository repository, IContractMapper contractMapper) { _logger = logger; _repository = repository; _contractMapper = contractMapper; }
public SingletonContainer() { this.repository = new InMemoryProductRepository(); this.mapper = new ContractMapper(); }
public SingletonContainer() { this.repository = new InMemoryProductRepository(); this.mapper = new ContractMapper(); }