public void ReadTimeIntegrationSetting_EmptyTable_ReturnNull() { // Setup using (var reader = new HydraRingSettingsDatabaseReader(emptyDatabasePath)) { // Call TimeIntegrationSetting setting = reader.ReadTimeIntegrationSetting(700131, 0); // Assert Assert.IsNull(setting); } }
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); } }
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); } }
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); } }
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); } }