Make tests pass with refactored ZaaImporter.
This commit is contained in:
@ -135,10 +135,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
||||
IList<String> paragraphs,
|
||||
Parameters parameterDictionary,
|
||||
Units unitDictionary)
|
||||
: this()
|
||||
: this(parameterDictionary, unitDictionary)
|
||||
{
|
||||
_parameterDictionary = parameterDictionary;
|
||||
_unitDictionary = unitDictionary;
|
||||
Paragraphs = paragraphs;
|
||||
}
|
||||
|
||||
@ -147,6 +145,15 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
||||
{
|
||||
}
|
||||
|
||||
public LaurisTimePoint(
|
||||
Parameters parameterDictionary,
|
||||
Units unitDictionary)
|
||||
: this()
|
||||
{
|
||||
_parameterDictionary = parameterDictionary;
|
||||
_unitDictionary = unitDictionary;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public methods
|
||||
|
@ -78,8 +78,18 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
||||
// create a new time point.
|
||||
if (LaurisTimePoint.IsTimeStampLine(paragraph))
|
||||
{
|
||||
timePoint = new LaurisTimePoint(paragraph);
|
||||
Laboratory.AddTimePoint(timePoint);
|
||||
timePoint = new LaurisTimePoint(paragraph, _parameters, _units);
|
||||
// Add the time point to the laboratory only if none
|
||||
// with the same time stamp exists yet.
|
||||
TimePoint existing = null;
|
||||
if (Laboratory.TryGetTimePoint(timePoint.TimeStamp, ref existing))
|
||||
{
|
||||
timePoint = existing as LaurisTimePoint;
|
||||
}
|
||||
else
|
||||
{
|
||||
Laboratory.AddTimePoint(timePoint);
|
||||
}
|
||||
}
|
||||
// If the current paragraph looks like a paragraph with
|
||||
// laboratory items, add it to the current time point;
|
||||
@ -88,7 +98,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
||||
{
|
||||
if (timePoint == null)
|
||||
{
|
||||
timePoint = new LaurisTimePoint();
|
||||
timePoint = new LaurisTimePoint(_parameters, _units);
|
||||
Laboratory.AddTimePoint(timePoint);
|
||||
}
|
||||
timePoint.AddParagraph(paragraph);
|
||||
|
Reference in New Issue
Block a user