public void TestNoErrorOnSamples() { foreach (string pth in SamplesAasxDir.ListAasxPaths()) { using (var tmpDir = new TemporaryDirectory()) { using (var consoleCap = new ConsoleCapture()) { int code = AasxToolkit.Program.MainWithExitCode( new[] { "load", pth, "export-template", Path.Combine(tmpDir.Path, "exported.template") }); if (consoleCap.Error() != "") { throw new AssertionException( $"Expected no stderr, but got:{System.Environment.NewLine}" + consoleCap.Error()); } Assert.AreEqual(0, code); } } } }
public void TestNoErrorOnSamples() { foreach (string pth in SamplesAasxDir.ListAasxPaths()) { using (var tmpDir = new TemporaryDirectory()) { using (var consoleCap = new ConsoleCapture()) { string targetPth = Path.Combine(tmpDir.Path, "saved.xml"); int code = AasxToolkit.Program.MainWithExitCode( new[] { "load", pth, "check", "save", targetPth }); if (consoleCap.Error() != "") { throw new AssertionException( $"Expected no stderr, but got:{System.Environment.NewLine}" + consoleCap.Error() + System.Environment.NewLine + System.Environment.NewLine + $"The executed command was: " + $"AasxToolkit load {pth} check save {targetPth}"); } Assert.AreEqual(0, code); } } } }
public void TestNoErrorOnSamples() { foreach (string pth in SamplesAasxDir.ListAasxPaths()) { using (var tmpDir = new TemporaryDirectory()) { using (var consoleCap = new ConsoleCapture()) { int code = AasxToolkit.Program.MainWithExitCode( new[] { "load", pth, "export-template", Path.Combine(tmpDir.Path, "exported.template") }); Assert.AreEqual(0, code); Assert.AreEqual("", consoleCap.Error()); } } } }