Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit b8852d1f authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

adding testcase for writing xml reports

parent d4de9a1c
No related branches found
No related tags found
No related merge requests found
......@@ -289,5 +289,39 @@ namespace TUGraz.VectoCore.Tests.Reports
fh.Close();
}
[TestCase("Tractor_4x2_vehicle-class-5_EURO6_2018.RSLT_MANUFACTURER.xml"),
TestCase("Tractor_4x2_vehicle-class-5_EURO6_2018.RSLT_CUSTOMER.xml"),
TestCase("Tractor_4x2_vehicle-class-5_EURO6_2018.RSLT_MONITORING.xml"),
]
public void TestXMLReportFileIsLocked(string xmlFile)
{
var jobFile = @"TestData\Integration\DeclarationMode\Class5_Vocational\Tractor_4x2_vehicle-class-5_EURO6_2018.xml";
var reportFile = Path.Combine(Path.GetDirectoryName(jobFile), xmlFile);
// lock modfile so it can't be written
Stream fh = !File.Exists(reportFile) ? File.Create(reportFile) : File.OpenRead(reportFile);
var writer = new FileOutputWriter(jobFile);
var inputData = new XMLDeclarationInputDataProvider(jobFile, true);
var factory = new SimulatorFactory(ExecutionMode.Declaration, inputData, writer) {
WriteModalResults = true,
ActualModalData = true
};
var sumWriter = new SummaryDataContainer(writer);
var jobContainer = new JobContainer(sumWriter);
jobContainer.AddRuns(factory);
jobContainer.Execute();
jobContainer.WaitFinished();
Assert.AreEqual(2, sumWriter.Table.Rows.Count);
fh.Close();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment