Code development platform for open source projects from the European Union institutions

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

more rigid tests for mod-file

parent e406aea7
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ using System.IO;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using TUGraz.VectoCommon.Utils;
using TUGraz.VectoCore.Models.Simulation.Data;
using TUGraz.VectoCore.Utils;
namespace TUGraz.VectoCore.Tests.Utils
......@@ -58,6 +59,15 @@ namespace TUGraz.VectoCore.Tests.Utils
var expected = VectoCSVFile.Read(result.expectedFile);
var actual = VectoCSVFile.Read(result.actualFile);
Assert.IsTrue(
actual.Rows.Cast<DataRow>()
.All(r => r.ParseDouble(ModalResultField.v_act.GetShortCaption()).IsGreaterOrEqual(0)),
"v_act must not be negative.");
Assert.IsTrue(
actual.Rows.Cast<DataRow>()
.All(r => r.ParseDouble(ModalResultField.v_targ.GetShortCaption()).IsGreaterOrEqual(0)),
"v_targ must not be negative.");
if (testRowcount) {
Assert.AreEqual(expected.Rows.Count, actual.Rows.Count,
string.Format("Moddata: Row count differs.\nExpected {0} Rows in {1}\nGot {2} Rows in {3}", expected.Rows.Count,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment