zaaReloaded2/Tests/Importer/ZaaImporter/LaurisParagraphTest.cs

47 lines
1.5 KiB
C#
Raw Normal View History

2015-06-29 19:50:27 +00:00
/* LaurisParagraphTest.cs
* part of zaaReloaded2
*
* Copyright 2015 Daniel Kraus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using NUnit.Framework;
2015-07-06 13:48:43 +00:00
using zaaReloaded2.LabModel;
using zaaReloaded2.Importer.ZaaImporter;
2015-06-29 19:50:27 +00:00
2015-07-06 13:48:43 +00:00
namespace Tests.Importer.ZaaImporter
2015-06-29 19:50:27 +00:00
{
[TestFixture]
class LaurisParagraphTest
{
[Test]
public void ParseParagraph()
{
string demo = "Klinische Chemie: Natrium: 139 [135 - 145] mmol/l;  " +
"Kalium: 5.2 [3.5 - 5] mmol/l;  Calcium: 2.4 [2.0 - 2.7] mmol/l;";
LaurisParagraph lp = new LaurisParagraph(demo);
2015-06-30 19:47:30 +00:00
Assert.IsTrue(lp.IsLaurisParagraph);
2015-06-29 19:50:27 +00:00
Assert.AreEqual(139, lp.Items["Natrium"].NumericalValue);
Assert.AreEqual(2.4, lp.Items["Calcium"].NumericalValue);
}
2015-06-30 19:47:30 +00:00
[Test]
public void ParseInvalidParagraph()
{
string demo = "Aktuelle Diagnosen:";
LaurisParagraph lp = new LaurisParagraph(demo);
Assert.IsFalse(lp.IsLaurisParagraph);
}
2015-06-29 19:50:27 +00:00
}
}