Пример #1
0
        private void AssertSuccess(TxMark.Result result)
        {
            StringBuilder message = new StringBuilder();

            foreach (var diagnostic in result.Diagnostics)
            {
                message.AppendLine(diagnostic.ToString());
            }
            Assert.IsTrue(result.Success, message.ToString());
        }
Пример #2
0
        private void TestWith <TModel>(TModel model, string templatePath)
        {
            var options = new TxMark.Options()
            {
                ForceCompile    = true,
                DiagnosticLevel = DiagnosticLevel.Information,
            };

            TxMark.Result result = TxMark.Engine.Execute <TModel>(templatePath, model, options);
            AssertSuccess(result);
            var expectedOutputPath = Path.Combine(Path.GetDirectoryName(templatePath), Path.GetFileNameWithoutExtension(templatePath) + ".expected");

            CheckOutput(expectedOutputPath, result.OutputStream);
        }