Esempio n. 1
0
        public void ReadTimeIntegrationSetting_EmptyTable_ReturnNull()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(emptyDatabasePath))
            {
                // Call
                TimeIntegrationSetting setting = reader.ReadTimeIntegrationSetting(700131, 0);

                // Assert
                Assert.IsNull(setting);
            }
        }
Esempio n. 2
0
        public void ReadTimeIntegrationSetting_ValidLocationIdAndFailureMechanismTypeNotInDatabase_ReturnNull(long locationId, HydraRingFailureMechanismType calculationType)
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(completeDatabasePath))
            {
                // Call
                TimeIntegrationSetting setting = reader.ReadTimeIntegrationSetting(locationId, calculationType);

                // Assert
                Assert.IsNull(setting);
            }
        }
Esempio n. 3
0
        public void ReadTimeIntegrationSetting_InvalidValueInReadLocation_ThrowsCriticalFileReadException()
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(invalidDatabasePath))
            {
                // Call
                TestDelegate test = () => reader.ReadTimeIntegrationSetting(700131, HydraRingFailureMechanismType.AssessmentLevel);

                // Assert
                Assert.Throws <CriticalFileReadException>(test);
            }
        }
Esempio n. 4
0
        public void ReadTimeIntegrationSetting_InvalidFailureMechanismType_ThrowsInvalidEnumArgumentException(HydraRingFailureMechanismType calculationType)
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(completeDatabasePath))
            {
                // Call
                TestDelegate test = () => reader.ReadTimeIntegrationSetting(123, calculationType);

                // Assert
                Assert.Throws <InvalidEnumArgumentException>(test);
            }
        }
Esempio n. 5
0
        public void ReadTimeIntegrationSetting_ValidLocationIdAndFailureMechanismType_TimeIntegrationSettingWithExpectedValues(
            long locationId, HydraRingFailureMechanismType calculationType, int expectedTimeIntegrationScheme)
        {
            // Setup
            using (var reader = new HydraRingSettingsDatabaseReader(completeDatabasePath))
            {
                // Call
                TimeIntegrationSetting setting = reader.ReadTimeIntegrationSetting(locationId, calculationType);

                // Assert
                Assert.AreEqual(expectedTimeIntegrationScheme, setting.TimeIntegrationSchemeId);
            }
        }