/// <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
 }
示例#5
0
 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();
 }
示例#6
0
        public void MapperIsCorrect([Frozen] IContractMapper expectedMapper, ProductManagementService sut)
        {
            // Fixture setup
            // Exercise system
            IContractMapper result = sut.Mapper;

            // Verify outcome
            Assert.Equal(expectedMapper, result);
            // Teardown
        }
示例#7
0
        public void CreateWithNullContractMapperWillThrow(ProductRepository repository)
        {
            // Fixture setup
            IContractMapper nullMapper = null;

            // Exercise system and verify outcome
            Assert.Throws <ArgumentNullException>(() =>
                                                  new ProductManagementService(repository, nullMapper));
            // Teardown
        }
示例#8
0
        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;
        }
示例#12
0
        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;
        }
示例#13
0
 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>();
		}
示例#15
0
 public SingletonContainer()
 {
     // creates singletons
     repository = new InMemoryProductRepository();
     mapper     = new ContractMapper();
 }
示例#16
0
 public ContractFinderConroller(ILogger <ContractFinderConroller> logger, IRepository repository, IContractMapper contractMapper)
 {
     _logger         = logger;
     _repository     = repository;
     _contractMapper = contractMapper;
 }
示例#17
0
 public SingletonContainer()
 {
     this.repository =
         new InMemoryProductRepository();
     this.mapper = new ContractMapper();
 }
		public SingletonContainer()
		{
			this.repository =
				new InMemoryProductRepository();
			this.mapper = new ContractMapper();
		}