Esempio n. 1
0
        public void ReadPreprocessorSetting_InvalidValueInReadLocation_ThrowsCriticalFileReadException()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(invalidDatabasePath))
            {
                // Call
                TestDelegate test = () => reader.ReadPreprocessorSetting(700131);

                // Assert
                Assert.Throws <CriticalFileReadException>(test);
            }
        }
Esempio n. 2
0
        public void ReadPreprocessorSetting_ValidLocationIdNotInDatabase_ReturnNull()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(emptyDatabasePath))
            {
                // Call
                ReadPreprocessorSetting preprocessorSetting = reader.ReadPreprocessorSetting(700131);

                // Assert
                Assert.IsNull(preprocessorSetting);
            }
        }
Esempio n. 3
0
        public void ReadPreprocessorSetting_ValidLocationId_ReadPreprocessorSettingWithExpectedValues(long locationId,
                                                                                                      double valueMin,
                                                                                                      double valueMax)
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(completeDatabasePath))
            {
                // Call
                ReadPreprocessorSetting preprocessorSetting = reader.ReadPreprocessorSetting(locationId);

                // Assert
                Assert.AreEqual(valueMin, preprocessorSetting.ValueMin);
                Assert.AreEqual(valueMax, preprocessorSetting.ValueMax);
            }
        }