Initial implementation of ItemComments.

This commit is contained in:
Daniel Kraus
2015-08-29 03:16:44 +02:00
parent efbff88b1a
commit a89a8103e5
9 changed files with 442 additions and 12 deletions

View File

@ -181,6 +181,28 @@ namespace Tests.Controller.Elements
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
public void ItemCommentWithoutHandler()
{
Laboratory lab = new Laboratory();
TimePoint tp = new TimePoint();
tp.TimeStamp = new DateTime(2015, 7, 13, 13, 31, 00);
tp.AddItem(new LabItem("Na", "133", "133"));
tp.AddItem(new LabItem("K", "6", "5"));
lab.AddTimePoint(tp);
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(
new zaa.Items("Na \"(Zielbereich: <> mmol/l)\""));
_formatter.Run();
string expected = (
StripMarkup(
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"Na 133\r\r").Replace(Environment.NewLine, "\r")
);
Assert.AreEqual(expected, _document.Range().Text);
}
static string StripMarkup(string s)
{
return _markupStripper.Replace(s, string.Empty);