2015-07-13 21:57:35 +00:00
|
|
|
|
/* FormatterTest.cs
|
2015-07-04 10:09:39 +00:00
|
|
|
|
* 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 System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
2015-07-13 21:57:35 +00:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
using f = zaaReloaded2.Formatter;
|
2015-07-06 13:48:43 +00:00
|
|
|
|
using zaaReloaded2.LabModel;
|
2015-07-13 21:57:35 +00:00
|
|
|
|
using zaaReloaded2.Importer.ZaaImporter;
|
2015-07-15 23:49:17 +00:00
|
|
|
|
using zaaReloaded2.Controller.Elements;
|
2015-07-13 21:57:35 +00:00
|
|
|
|
using Microsoft.Office.Interop.Word;
|
2015-07-04 10:09:39 +00:00
|
|
|
|
|
2015-07-13 21:57:35 +00:00
|
|
|
|
namespace Tests.Formatter
|
2015-07-04 10:09:39 +00:00
|
|
|
|
{
|
2015-07-13 21:57:35 +00:00
|
|
|
|
[TestFixture]
|
|
|
|
|
class FormatterTest
|
2015-07-04 10:09:39 +00:00
|
|
|
|
{
|
2015-07-13 21:57:35 +00:00
|
|
|
|
[Test]
|
|
|
|
|
public void FormatLaboratory()
|
2015-07-04 10:09:39 +00:00
|
|
|
|
{
|
2015-07-14 21:19:41 +00:00
|
|
|
|
Document document = new Document();
|
2015-07-13 21:57:35 +00:00
|
|
|
|
ZaaImporter importer = TestHelpers.ZaaImporterFromResource();
|
2015-07-14 21:19:41 +00:00
|
|
|
|
f.Formatter formatter = new f.Formatter(document);
|
2015-07-13 21:57:35 +00:00
|
|
|
|
formatter.Laboratory = importer.Laboratory;
|
2015-07-15 23:49:17 +00:00
|
|
|
|
formatter.Settings.Elements.Add(new Items("Klinische Chemie: Na, K, Cl"));
|
2015-07-14 21:19:41 +00:00
|
|
|
|
formatter.Run();
|
|
|
|
|
Assert.AreEqual("Klinische Chemie: Na 144 mM, K 4,3 mM\r", document.Range().Text);
|
|
|
|
|
((_Document)document).Close(WdSaveOptions.wdDoNotSaveChanges);
|
2015-07-04 10:09:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|