Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Readers/ConfigurationReaderTest.cs =================================================================== diff -u -re55a25791932bd0452d1f01e331794a57e4db15d -r7594d7f46113b5c5f4f41bfbd0183a3789f648b9 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Readers/ConfigurationReaderTest.cs (.../ConfigurationReaderTest.cs) (revision e55a25791932bd0452d1f01e331794a57e4db15d) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Readers/ConfigurationReaderTest.cs (.../ConfigurationReaderTest.cs) (revision 7594d7f46113b5c5f4f41bfbd0183a3789f648b9) @@ -40,7 +40,7 @@ private readonly string validMainSchemaDefinition; private readonly string testDirectoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, - "ConfigurationReader"); + "CalculationConfigurationReader"); private static IEnumerable InvalidConfigurations { @@ -62,7 +62,7 @@ public void Constructor_NoFilePath_ThrowArgumentException(string invalidFilePath) { // Call - TestDelegate call = () => new ConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet leeg of ongedefinieerd zijn."; @@ -78,7 +78,7 @@ string invalidFilePath = validFilePath.Replace("Config", invalidPathChars[3].ToString()); // Call - TestDelegate call = () => new ConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': " @@ -93,7 +93,7 @@ string invalidFilePath = Path.Combine(testDirectoryPath, Path.DirectorySeparatorChar.ToString()); // Call - TestDelegate call = () => new ConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': bestandspad mag niet verwijzen naar een lege bestandsnaam."; @@ -107,7 +107,7 @@ string invalidFilePath = Path.Combine(testDirectoryPath, "notExisting.xml"); // Call - TestDelegate call = () => new ConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(invalidFilePath, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{invalidFilePath}': het bestand bestaat niet."; @@ -125,7 +125,7 @@ string filePath = Path.Combine(testDirectoryPath, fileName); // Call - TestDelegate call = () => new ConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{filePath}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; @@ -145,7 +145,7 @@ fileDisposeHelper.LockFiles(); // Call - TestDelegate call = () => new ConfigurationReader(path, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(path, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; @@ -163,7 +163,7 @@ string xsdPath = Path.Combine(testDirectoryPath, "mainSchemaDefinitionNotReferencingDefaultSchema.xsd"); // Call - TestDelegate call = () => new ConfigurationReader(filePath, File.ReadAllText(xsdPath), new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(filePath, File.ReadAllText(xsdPath), new Dictionary()); // Assert var exception = Assert.Throws(call); @@ -178,7 +178,7 @@ string filePath = Path.Combine(testDirectoryPath, fileName); // Call - TestDelegate call = () => new ConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); // Assert var exception = Assert.Throws(call); @@ -193,7 +193,7 @@ string filePath = Path.Combine(testDirectoryPath, "invalidFolderNoName.xml"); // Call - TestDelegate call = () => new ConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{filePath}': het XML-document dat de configuratie" + @@ -210,7 +210,7 @@ string filePath = Path.Combine(testDirectoryPath, "emptyConfiguration.xml"); // Call - TestDelegate call = () => new ConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); // Assert string expectedMessage = $"Fout bij het lezen van bestand '{filePath}': het XML-document dat de configuratie" + @@ -226,7 +226,7 @@ string filePath = Path.Combine(testDirectoryPath, "validConfiguration.xml"); // Call - TestDelegate call = () => new ConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); + TestDelegate call = () => new CalculationConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); // Assert Assert.DoesNotThrow(call); @@ -237,7 +237,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationEmptyFolder.xml"); - var configurationReader = new ConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); + var configurationReader = new CalculationConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); // Call IList readConfigurationItems = configurationReader.Read().ToList(); @@ -256,7 +256,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfiguration.xml"); - var configurationReader = new ConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); + var configurationReader = new CalculationConfigurationReader(filePath, validMainSchemaDefinition, new Dictionary()); // Call IList readConfigurationItems = configurationReader.Read().ToList(); @@ -318,11 +318,11 @@ validMainSchemaDefinition = File.ReadAllText(Path.Combine(testDirectoryPath, "validConfigurationSchema.xsd")); } - private class ConfigurationReader : ConfigurationReader + private class CalculationConfigurationReader : CalculationConfigurationReader { - public ConfigurationReader(string xmlFilePath, - string mainSchemaDefinition, - IDictionary nestedSchemaDefinitions) + public CalculationConfigurationReader(string xmlFilePath, + string mainSchemaDefinition, + IDictionary nestedSchemaDefinitions) : base(xmlFilePath, mainSchemaDefinition, nestedSchemaDefinitions) {} protected override ReadCalculation ParseCalculationElement(XElement calculationElement)