private kWhStorage GetStorageProviderForPath(string originalQbxPath) { var serial = QbxPathUtils.GetSerialFromPath(originalQbxPath); var baseDir = QbxPathUtils.GetBaseDirFromPath(originalQbxPath); var counterId = QbxPathUtils.GetCounterIdFromPath(originalQbxPath); var storageId = QbxPathUtils.GetStorageIdFromPath(originalQbxPath); return(new kWhStorage(serial, baseDir, counterId, Precision.mWh, storageId)); }
private kWhStorage GetStorageProviderForPath(string originalQbxPath) { var storageProviderContext = new StorageProviderContext { SerialNumber = QbxPathUtils.GetSerialFromPath(originalQbxPath), CounterId = QbxPathUtils.GetCounterIdFromPath(originalQbxPath), Precision = Precision.mWh, StorageId = QbxPathUtils.GetStorageIdFromPath(originalQbxPath) }; IOptions <kWhStorageOptions> options = new OptionsWrapper <kWhStorageOptions>(_kWhStorageOptions); // Override path. options.Value.DataStorePath = QbxPathUtils.GetBaseDirFromPath(originalQbxPath); return(new kWhStorage(_loggerFactory, options, storageProviderContext)); }
public void TestGetCounterIdFromPath(string path, int expectedCounterId) { int counterId = QbxPathUtils.GetCounterIdFromPath(path); Assert.That(counterId, Is.EqualTo(expectedCounterId)); }