Make tests pass again (except not implemented ones).

This commit is contained in:
Daniel Kraus 2015-08-05 20:02:02 +02:00
parent b7fdf87ea5
commit 742a588083
4 changed files with 21 additions and 9 deletions

View File

@ -61,7 +61,7 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Na, K, Cl"));
_formatter.Run();
Assert.AreEqual("Na 133, K 6 (5)\r", _document.Range().Text);
Assert.AreEqual("\r13.07.2015 13:31:00:\rNa 133, K 6 (5)\r\r", _document.Range().Text);
}
[Test]
@ -78,7 +78,7 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, K, Cl"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, K 6 (5)\r", _document.Range().Text);
Assert.AreEqual("\r13.07.2015 13:31:00:\rKlinische Chemie: Na 133, K 6 (5)\r\r", _document.Range().Text);
}
[Test]
@ -113,7 +113,7 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, *"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, Cl 110, K 6\r",
Assert.AreEqual("\r13.07.2015 13:31:00:\rKlinische Chemie: Na 133, Cl 110, K 6\r\r",
_document.Range().Text);
}
@ -133,7 +133,7 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, SU-*"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, SU-Protein 2,8\r",
Assert.AreEqual("\r13.07.2015 13:31:00:\rKlinische Chemie: Na 133, SU-Protein 2,8\r\r",
_document.Range().Text);
}
@ -153,7 +153,7 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, SU-*, *"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, SU-Protein 2,8, Cl 110, U-Na 99\r",
Assert.AreEqual("\r13.07.2015 13:31:00:\rKlinische Chemie: Na 133, SU-Protein 2,8, Cl 110, U-Na 99\r\r",
_document.Range().Text);
}
}

View File

@ -50,11 +50,13 @@ namespace Tests.Controller
string testName = "test";
s.Name = testName;
sr.SettingsList.Add(s);
int expected = sr.SettingsList.Count;
int index = sr.SettingsList.IndexOf(s);
sr.Store();
sr = null;
sr = SettingsRepository.Load();
Assert.AreEqual(1, sr.SettingsList.Count);
Assert.AreEqual(testName, sr.SettingsList[0].Name);
Assert.AreEqual(expected, sr.SettingsList.Count);
Assert.AreEqual(testName, sr.SettingsList[index].Name);
}
}
}

View File

@ -58,7 +58,7 @@ namespace zaaReloaded2.Controller
#region Constructors
public Settings()
: this(string.Empty, new List<ElementBase>())
: this(string.Empty, null)
{ }
public Settings(string name)
@ -87,6 +87,10 @@ namespace zaaReloaded2.Controller
Uid = Guid.NewGuid();
Name = name;
Elements = initialElements;
if (Elements == null)
{
Elements = new List<ElementBase>();
}
}
#endregion

View File

@ -87,7 +87,13 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// Is true if the LaurisText has time stamp in the first
/// paragraph and <see cref="LabItem"/>s in the others.
/// </summary>
public bool IsValidTimePoint { get; private set; }
public bool IsValidTimePoint
{
get
{
return Items.Count > 0;
}
}
/// <summary>
/// Gets or sets the original Lauris text for this timepoint.