Make formatter tests pass.

This commit is contained in:
Daniel Kraus 2015-08-09 19:54:48 +02:00
parent b59c9f2898
commit 11b9b9df54
7 changed files with 23 additions and 21 deletions

View File

@ -61,9 +61,10 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Na, K, Cl"));
_formatter.Run();
Assert.AreEqual("\r" +
string expected = (
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"\rNa 133, K 6 (5)\r\r", _document.Range().Text);
"Na 133, K 6 (5)\r\r").Replace(Environment.NewLine, "\r");
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -80,9 +81,10 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, K, Cl"));
_formatter.Run();
Assert.AreEqual("\r" +
string expected = (
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"\rKlinische Chemie: Na 133, K 6 (5)\r\r", _document.Range().Text);
"Klinische Chemie: Na 133, K 6 (5)\r\r").Replace(Environment.NewLine, "\r");
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -117,10 +119,10 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, *"));
_formatter.Run();
Assert.AreEqual("\r" +
string expected = (
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"\rKlinische Chemie: Na 133, Cl 110, K 6\r\r",
_document.Range().Text);
"Klinische Chemie: Na 133, Cl 110, K 6\r\r").Replace(Environment.NewLine, "\r");
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -139,10 +141,10 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, SU-*"));
_formatter.Run();
Assert.AreEqual("\r" +
string expected = (
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"\rKlinische Chemie: Na 133, SU-Protein 2,8\r\r",
_document.Range().Text);
"Klinische Chemie: Na 133, SU-Protein 2,8\r\r").Replace(Environment.NewLine, "\r");
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -161,10 +163,11 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, SU-*, *"));
_formatter.Run();
Assert.AreEqual("\r" +
string expected = (
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"\rKlinische Chemie: Na 133, SU-Protein 2,8, Cl 110, U-Na 99\r\r",
_document.Range().Text);
"Klinische Chemie: Na 133, SU-Protein 2,8, Cl 110, U-Na 99\r\r")
.Replace(Environment.NewLine, "\r");
Assert.AreEqual(expected, _document.Range().Text);
}
}
}

View File

@ -1,7 +1,7 @@

04.07.2015 12:31:00:
Laborwerte vom 04.07.2015 12:31:00:
Klinische Chemie: Na 144 mM, K 4,3 mM
06.07.2015 10:28:00:
Laborwerte vom 06.07.2015 10:28:00:
Klinische Chemie: Na 138 mM, K 4,6 mM

View File

@ -1,7 +1,7 @@

04.07.2015:
Laborwerte vom 04.07.2015:
Klinische Chemie: Na 144 mM, K 4,3 mM
06.07.2015:
Laborwerte vom 06.07.2015:
Klinische Chemie: Na 138 mM, K 4,6 mM

View File

@ -1,4 +1,4 @@

04.07.2015:
Laborwerte vom 04.07.2015:
Klinische Chemie: Na 144 mM, K 4,3 mM

View File

@ -1,4 +1,4 @@

06.07.2015:
Laborwerte vom 06.07.2015:
Klinische Chemie: Na 138 mM, K 4,6 mM

View File

@ -55,7 +55,6 @@ namespace Tests.Formatter
{
_formatter.Settings.Elements.Add(new Items("Klinische Chemie: Na, K, Cl"));
_formatter.Run();
Console.WriteLine(_document.Range().Text);
Assert.AreEqual(
GetResourceText("Tests.Formatter.FormatterTest-all.txt"),
_document.Range().Text);

View File

@ -40,7 +40,7 @@ namespace Tests.Importer.ZaaImporter
[Test]
public void ParseInvalidLaurisTimePoints()
{
LaurisTimePoint tp = new LaurisTimePoint("Aerobe Kultur: Enterokokken ;  Wachstum: 10 ;");
LaurisTimePoint tp = new LaurisTimePoint("Mit freundlichen Grüßen");
Assert.IsFalse(tp.IsValidTimePoint,
"Bogus paragraph should be invalid LaurisTimePoint");