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(); }
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; }
public FileServerService(IImagemRepository imagemRepository, IGeekStoreDbContextService geekStoreDbContextService, INotificationService notification, IOptions <FileServerSettings> fileServerSettings) : base(notification) { _imagemRepository = imagemRepository; _fileServerSettings = fileServerSettings.Value; _geekStoreDbContextService = geekStoreDbContextService; }
// 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; }