コード例 #1
0
        public RaceServiceTests()
        {
            this._raceFileReaderMock         = new Mock <IRaceFileReader>();
            this._raceRepositoryMock         = new Mock <IRaceRepository>();
            this._raceQueryMock              = new Mock <IRaceQuery>();
            this._raceTypeRepositoryMock     = new Mock <IRaceTypeRepository>();
            this._raceTypeQueryMock          = new Mock <IRaceTypeQuery>();
            this._userRepositoryMock         = new Mock <IUserRepository>();
            this._userQueryMock              = new Mock <IUserQuery>();
            this._lapRepositoryMock          = new Mock <ILapRepository>();
            this._driverResultRepositoryMock = new Mock <IDriverResultRepository>();
            this._driverResultQueryMock      = new Mock <IDriverResultQuery>();

            //Configurar FileServerSettings.
            this._fileServerSettingsOptionsMock = new Mock <IOptions <FileServerSettings> >();
            FileServerSettings fileServerSettings = new FileServerSettings();

            TestUtil.GetConfiguration().GetSection("FileServer").Bind(fileServerSettings);
            this._fileServerSettingsOptionsMock.Setup(x => x.Value).Returns(fileServerSettings);

            //Configurar RaceFileSettings.
            this._raceFileSettingsOptionsMock = new Mock <IOptions <RaceFileSettings> >();
            RaceFileSettings raceFileSettings = new RaceFileSettings();

            TestUtil.GetConfiguration().GetSection("RaceFile").Bind(raceFileSettings);
            this._raceFileSettingsOptionsMock.Setup(x => x.Value).Returns(raceFileSettings);

            MapperConfiguration mapperConfiguration = new MapperConfiguration(mConfig =>
            {
                mConfig.AddProfile(new ServiceMapperProfile());
            });

            this._mapper = mapperConfiguration.CreateMapper();
        }
コード例 #2
0
ファイル: RaceService.cs プロジェクト: yagohf/race-analyser
 public RaceService(IRaceFileReader raceFileProcessor,
                    IRaceRepository raceRepository,
                    IRaceQuery raceQuery,
                    IRaceTypeRepository raceTypeRepository,
                    IRaceTypeQuery raceTypeQuery,
                    IUserRepository userRepository,
                    IUserQuery userQuery,
                    ILapRepository lapRepository,
                    IDriverResultRepository driverResultRepository,
                    IDriverResultQuery driverResultQuery,
                    IOptions <FileServerSettings> fileServerOptions,
                    IOptions <RaceFileSettings> raceFileOptions,
                    IMapper mapper)
 {
     this._raceFileReader         = raceFileProcessor;
     this._raceRepository         = raceRepository;
     this._raceQuery              = raceQuery;
     this._raceTypeRepository     = raceTypeRepository;
     this._raceTypeQuery          = raceTypeQuery;
     this._userRepository         = userRepository;
     this._userQuery              = userQuery;
     this._lapRepository          = lapRepository;
     this._driverResultRepository = driverResultRepository;
     this._driverResultQuery      = driverResultQuery;
     this._fileServerSettings     = fileServerOptions.Value;
     this._raceFileSettings       = raceFileOptions.Value;
     this._mapper = mapper;
 }
コード例 #3
0
 public FileServerService(IImagemRepository imagemRepository,
                          IGeekStoreDbContextService geekStoreDbContextService,
                          INotificationService notification,
                          IOptions <FileServerSettings> fileServerSettings) : base(notification)
 {
     _imagemRepository          = imagemRepository;
     _fileServerSettings        = fileServerSettings.Value;
     _geekStoreDbContextService = geekStoreDbContextService;
 }
コード例 #4
0
ファイル: ServerInit.cs プロジェクト: Blankpanda/chat_client
        // TODO: start different servers based on desire, currently have to programatically do it
        /// <summary>
        ///  Creats and initalize a file server
        /// </summary>
        /// <returns></returns>
        public FileServerSettings CreateFileServer(string ServerName)
        {
            FileServerSettings settings = new FileServerSettings();
            ServerList serverlist = new ServerList();

            settings.server_password = GetServerPassword();
            settings.backlog = GetServerBacklog();
            settings.port_number = GetServerPortNumber();
            settings.server_ip_address = GetServerIPAddress();

            return settings;
        }