Index: Ringtoets/Common/src/Ringtoets.Common.IO/AssessmentSectionSettingsReader.cs
===================================================================
diff -u -r5253591e2ead1fb1e5e23dc0506f62c661be023c -r74099cffbe88647dbc4c81a3935d12cf5959b858
--- Ringtoets/Common/src/Ringtoets.Common.IO/AssessmentSectionSettingsReader.cs (.../AssessmentSectionSettingsReader.cs) (revision 5253591e2ead1fb1e5e23dc0506f62c661be023c)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/AssessmentSectionSettingsReader.cs (.../AssessmentSectionSettingsReader.cs) (revision 74099cffbe88647dbc4c81a3935d12cf5959b858)
@@ -24,11 +24,12 @@
using System.IO;
using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.IO.Properties;
namespace Ringtoets.Common.IO
{
///
- /// Reads the settings file defined at level.
+ /// Reads the settings defined at level.
///
public class AssessmentSectionSettingsReader
{
@@ -38,44 +39,21 @@
private const string duneAssessmentSectionFlag = "Duin";
///
- /// Reads the settings.
+ /// Reads the settings from .
///
- /// The file path.
- ///
- /// When is null.
- /// When is an empty string.
- /// When points
- /// to a file that doesn't exist.
- /// When is invalid.
- /// When either
- ///
- /// - includes an incorrect
- /// or invalid syntax for file name, directory name, or volume label.
- /// - When an I/O error occurs while reading the file.
- ///
- /// When there is insufficient memory to allocate
- /// a buffer to a line in the file.
- /// When reading a line that does not have
- /// at least 2 columns or when the line doesn't have columns aren't separated by a ';'.
- /// When reading a line where the second column text
- /// doesn't represent a number.
- /// When reading a line where the second column text
- /// represents a number that is too big or too small to be stored in a .
- public AssessmentSectionSettings[] ReadSettings(string filePath)
+ /// The fully initialized settings.
+ public AssessmentSectionSettings[] ReadSettings()
{
- using (var reader = new StreamReader(filePath))
+ string[] ihwFileLines = Resources.IHW_filecontents.Split(new[]
{
- reader.ReadLine();// Skip header
-
- var list = new List();
- string currentLine;
- while (null != (currentLine = reader.ReadLine()))
- {
- AssessmentSectionSettings settingsDefinition = ReadAssessmentSectionSettings(currentLine);
- list.Add(settingsDefinition);
- }
- return list.ToArray();
+ Environment.NewLine
+ }, StringSplitOptions.None);
+ var resultArray = new AssessmentSectionSettings[ihwFileLines.Length - 1];
+ for (int i = 1; i < ihwFileLines.Length; i++)
+ {
+ resultArray[i-1] = ReadAssessmentSectionSettings(ihwFileLines[i]);
}
+ return resultArray;
}
///
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs
===================================================================
diff -u -r8ab20e71c86b0a20f269eb7122efee529011136b -r74099cffbe88647dbc4c81a3935d12cf5959b858
--- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 8ab20e71c86b0a20f269eb7122efee529011136b)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 74099cffbe88647dbc4c81a3935d12cf5959b858)
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
+// Runtime Version:4.0.30319.18444
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -97,6 +97,78 @@
}
///
+ /// Looks up a localized string similar to TRAJECT_ID;N
+ ///1-1;3
+ ///1-2;2
+ ///2-1;Duin
+ ///2-2;2
+ ///3-1;Duin
+ ///3-2;2
+ ///4-1;Duin
+ ///4-2;2
+ ///5-1;Duin
+ ///5-2;2
+ ///6-1;3
+ ///6-2;3
+ ///6-3;3
+ ///6-4;3
+ ///6-5;3
+ ///6-6;3
+ ///6-7;3
+ ///7-1;3
+ ///7-2;3
+ ///8-1;3
+ ///8-2;3
+ ///8-3;3
+ ///8-4;3
+ ///8-5;2
+ ///8-6;2
+ ///8-7;2
+ ///9-1;2
+ ///9-2;2
+ ///10-1;2
+ ///10-2;2
+ ///10-3;2
+ ///11-1;2
+ ///11-2;2
+ ///11-3;2
+ ///12-1;3
+ ///12-2;2
+ ///13-1;Duin
+ ///13-2;3
+ ///13-3;Duin
+ ///13-4;3
+ ///13-5;3
+ ///13-6;2
+ ///13-7;2
+ ///13-8;2
+ ///13-9;2
+ ///13a-1;2
+ ///13b-1;2
+ ///14-1;2
+ ///14-2;2
+ ///14-3;2
+ ///14-4;2
+ ///14-5;Duin
+ ///14-6;3
+ ///14-7;Duin
+ ///14-8;3
+ ///14-9;Duin
+ ///14-10;3
+ ///15-1;1
+ ///15-2;2
+ ///15-3;2
+ ///16-1;1
+ ///16-2;2
+ /// [rest of string was truncated]";.
+ ///
+ public static string IHW_filecontents {
+ get {
+ return ResourceManager.GetString("IHW_filecontents", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Als u de referentielijn vervangt, zullen alle vakindelingen, berekende hydraulische randvoorwaarden en berekeningsresultaten worden verwijderd.
///
///Weet u zeker dat u wilt doorgaan?.
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx
===================================================================
diff -u -r8ab20e71c86b0a20f269eb7122efee529011136b -r74099cffbe88647dbc4c81a3935d12cf5959b858
--- Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 8ab20e71c86b0a20f269eb7122efee529011136b)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Properties/Resources.resx (.../Resources.resx) (revision 74099cffbe88647dbc4c81a3935d12cf5959b858)
@@ -168,4 +168,8 @@
Het bestand bevat geen waarde voor 'TrackID'.
+
+
+ ..\Resources\20160624v3 N-waarden voor GEKB en HTKW.csv;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
+
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Resources/20160624v3 N-waarden voor GEKB en HTKW.csv
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.IO/Resources/20160624v3 N-waarden voor GEKB en HTKW.csv (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Resources/20160624v3 N-waarden voor GEKB en HTKW.csv (revision 74099cffbe88647dbc4c81a3935d12cf5959b858)
@@ -0,0 +1,238 @@
+TRAJECT_ID;N
+1-1;3
+1-2;2
+2-1;Duin
+2-2;2
+3-1;Duin
+3-2;2
+4-1;Duin
+4-2;2
+5-1;Duin
+5-2;2
+6-1;3
+6-2;3
+6-3;3
+6-4;3
+6-5;3
+6-6;3
+6-7;3
+7-1;3
+7-2;3
+8-1;3
+8-2;3
+8-3;3
+8-4;3
+8-5;2
+8-6;2
+8-7;2
+9-1;2
+9-2;2
+10-1;2
+10-2;2
+10-3;2
+11-1;2
+11-2;2
+11-3;2
+12-1;3
+12-2;2
+13-1;Duin
+13-2;3
+13-3;Duin
+13-4;3
+13-5;3
+13-6;2
+13-7;2
+13-8;2
+13-9;2
+13a-1;2
+13b-1;2
+14-1;2
+14-2;2
+14-3;2
+14-4;2
+14-5;Duin
+14-6;3
+14-7;Duin
+14-8;3
+14-9;Duin
+14-10;3
+15-1;1
+15-2;2
+15-3;2
+16-1;1
+16-2;2
+16-3;1
+16-4;1
+16-5;1
+17-1;2
+17-2;2
+17-3;2
+18-1;2
+19-1;2
+20-1;Duin
+20-2;2
+20-3;2
+20-4;2
+21-1;2
+21-2;2
+22-1;2
+22-2;2
+23-1;2
+24-1;1
+24-2;1
+24-3;1
+25-1;Duin
+25-2;2
+25-3;2
+25-4;2
+26-1;Duin
+26-2;2
+26-3;2
+26-4;2
+27-1;2
+27-2;2
+27-3;2
+27-4;2
+28-1;2
+29-1;Duin
+29-2;3
+29-3;3
+29-4;2
+30-1;2
+30-2;2
+30-3;2
+30-4;2
+31-1;2
+31-2;2
+31-3;2
+32-1;2
+32-2;2
+32-3;2
+32-4;2
+33-1;2
+34-1;2
+34-2;2
+34-3;2
+34-4;2
+34-5;2
+34a-1;2
+35-1;2
+35-2;2
+36-1;1
+36-2;1
+36-3;1
+36-4;1
+36-5;1
+36a-1;1
+37-1;1
+38-1;1
+38-2;1
+39-1;1
+40-1;1
+40-2;1
+41-1;1
+41-2;1
+41-3;1
+41-4;1
+42-1;1
+43-1;1
+43-2;1
+43-3;1
+43-4;1
+43-5;1
+43-6;1
+44-1;1
+44-2;2
+44-3;3
+45-1;1
+45-2;2
+45-3;2
+46-1;2
+47-1;1
+48-1;1
+48-2;1
+48-3;1
+49-1;1
+49-2;1
+50-1;1
+50-2;1
+51-1;1
+52-1;1
+52-2;1
+52-3;1
+52-4;1
+52a-1;1
+53-1;1
+53-2;1
+53-3;1
+54-1;1
+55-1;1
+56-1;1
+57-1;1
+58-1;1
+59-1;1
+60-1;1
+61-1;1
+62-1;1
+63-1;1
+64-1;1
+65-1;1
+66-1;1
+67-1;1
+68-1;1
+68-2;1
+69-1;1
+70-1;1
+71-1;1
+72-1;1
+73-1;1
+74-1;1
+75-1;1
+76-1;1
+76-2;1
+76a-1;1
+77-1;1
+78-1;1
+78a-1;1
+79-1;1
+80-1;1
+81-1;1
+82-1;1
+83-1;1
+84-1;1
+85-1;1
+86-1;1
+87-1;1
+88-1;1
+89-1;1
+90-1;1
+91-1;1
+92-1;1
+93-1;1
+94-1;1
+95-1;1
+201;3
+202;1
+204a;2
+204b;2
+205;1
+206;1
+208;2
+209;1
+210;2
+211;3
+212;1
+213;1
+214;3
+215;2
+216;2
+217;2
+218;3
+219;2
+221;2
+222;2
+223;2
+224;1
+225;2
+226;1
+227;1
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj
===================================================================
diff -u -r8e91f29f35b5f93ea1d9dfc7dcd79edfdd1b4e53 -r74099cffbe88647dbc4c81a3935d12cf5959b858
--- Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 8e91f29f35b5f93ea1d9dfc7dcd79edfdd1b4e53)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 74099cffbe88647dbc4c81a3935d12cf5959b858)
@@ -66,6 +66,7 @@
Copying.licenseheader
+
Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/AssessmentSectionSettingsReaderTest.cs
===================================================================
diff -u -r5253591e2ead1fb1e5e23dc0506f62c661be023c -r74099cffbe88647dbc4c81a3935d12cf5959b858
--- Ringtoets/Common/test/Ringtoets.Common.IO.Test/AssessmentSectionSettingsReaderTest.cs (.../AssessmentSectionSettingsReaderTest.cs) (revision 5253591e2ead1fb1e5e23dc0506f62c661be023c)
+++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/AssessmentSectionSettingsReaderTest.cs (.../AssessmentSectionSettingsReaderTest.cs) (revision 74099cffbe88647dbc4c81a3935d12cf5959b858)
@@ -34,12 +34,10 @@
public void ReadSettigns_FromValidFile_ReturnAllAssessmentSectionSettings()
{
// Setup
- string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO,
- Path.Combine("IHW", "20160624v3 N-waarden voor GEKB en HTKW.csv"));
var reader = new AssessmentSectionSettingsReader();
// Call
- AssessmentSectionSettings[] settingDefinitions = reader.ReadSettings(filePath);
+ AssessmentSectionSettings[] settingDefinitions = reader.ReadSettings();
// Assert
Assert.AreEqual(237, settingDefinitions.Length);
Fisheye: Tag 74099cffbe88647dbc4c81a3935d12cf5959b858 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.IO.Test/test-data/IHW/20160624v3 N-waarden voor GEKB en HTKW.csv'.
Fisheye: No comparison available. Pass `N' to diff?