Exemplo n.º 1
0
        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);
                    }
                }
            }
        }
Exemplo n.º 2
0
        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);
                    }
                }
            }
        }
Exemplo n.º 3
0
        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());
                    }
                }
            }
        }