예제 #1
0
        public DirectoryManager(IFileWriter fileWriter, IFileReader fileReader, IFilePathBuilder filePathBuilder, IDatabase database, IHttpContextAccessor httpContextAccessor)
        {
            this.fileWriter      = fileWriter;
            this.fileReader      = fileReader;
            this.filePathBuilder = filePathBuilder;
            this.database        = database;

            this.currentUserId = httpContextAccessor.HttpContext.GetCurrentUserId();
        }
 private void SetUpFilePathBuilder()
 {
     _filePathBuilder = Substitute.For <IFilePathBuilder>();
     _filePathBuilder.BuildFilePath(_deviceName, _humiditySensorType, _date).Returns(_humidityFilePath);
     _filePathBuilder.BuildFilePath(_deviceName, _rainfallSensorType, _date).Returns(_rainfallFilePath);
     _filePathBuilder.BuildFilePath(_deviceName, _temperatureSensorType, _date).Returns(_temperatureFilePath);
     _filePathBuilder.BuildHistoricalFilePath(_deviceName, _humiditySensorType).Returns(_humidityHistoricalFilePath);
     _filePathBuilder.BuildHistoricalFilePath(_deviceName, _rainfallSensorType).Returns(_rainfallHistoricalFilePath);
     _filePathBuilder.BuildHistoricalFilePath(_deviceName, _temperatureSensorType).Returns(_temperatureHistoricalFilePath);
 }
예제 #3
0
        public StorageManager(IFileWriter fileWriter, IFileReader fileReader, IFilePathBuilder filePathBuilder, IDatabase database,
                              IReadOnlyStorageSizeManager storageSizeManager, IHttpContextAccessor httpContextAccessor)
        {
            this.fileWriter         = fileWriter;
            this.fileReader         = fileReader;
            this.filePathBuilder    = filePathBuilder;
            this.database           = database;
            this.storageSizeManager = storageSizeManager;

            this.currentUserId = httpContextAccessor.HttpContext.GetCurrentUserId();
        }
예제 #4
0
 public DevicesHandler(
     IParserProvider parserProvider,
     IFilePathBuilder filePathBuilder,
     IBlobClientProvider blobClientProvider,
     Func <Stream, ZipArchive> zipArchiveProvider,
     IDeviceDataBuilder deviceDataBuilder)
 {
     _parserProvider     = parserProvider;
     _filePathBuilder    = filePathBuilder;
     _blobClientProvider = blobClientProvider;
     _zipArchiveProvider = zipArchiveProvider;
     _deviceDataBuilder  = deviceDataBuilder;
 }
예제 #5
0
 private void EnsureDirectoryExists(IFilePathBuilder filePathBuilder)
 {
     Directory.CreateDirectory(filePathBuilder.StorageDirectory);
 }
예제 #6
0
 public FileWorldStateSaver(IFilePathBuilder filePathBuilder)
 {
     _filePathBuilder = filePathBuilder;
 }
예제 #7
0
 /// <summary>
 /// Create a file system manager
 /// </summary>
 /// <param name="rootDirectory">root directory to store app data in
 ///                             this will be something like the general local Application data directory/</param>
 public FileSystemManager(IFilePathBuilder filePathBuilder)
 {
     this.filePathBuilder = filePathBuilder;
 }