public static void HasNotOutputFile(
            CodeExampleInfo codeExampleInfo)
        {
            var actualPath = codeExampleInfo.SourceCodePath + ".txt";

            Assert.IsTrue(!File.Exists(actualPath));
        }
 public static void HasError(
     CodeExampleInfo codeExampleInfo,
     string expected)
 {
     Assert.IsNotNull(codeExampleInfo.Error);
     Assert.AreNotEqual(notExpected: 0, actual: codeExampleInfo.ExitCode);
     Assert.AreEqual(expected: expected, actual: codeExampleInfo.Error);
 }
        public static void HasOutputFile(
            CodeExampleInfo codeExampleInfo,
            string expected)
        {
            HasExitCode(codeExampleInfo, 0);
            Assert.IsTrue(codeExampleInfo.HasSourceCode);
            var actualPath = codeExampleInfo.SourceCodePath + ".txt";

            Assert.IsTrue(File.Exists(actualPath));

            StringReader expectedReader = new StringReader(expected);

            using (StreamReader reader = new StreamReader(
                       actualPath, new UTF8Encoding(false)))
            {
                string expectedLine;
                while ((expectedLine = expectedReader.ReadLine()) != null)
                {
                    var actualLine = reader.ReadLine();
                    Assert.AreEqual(expectedLine, actualLine);
                }
            }
        }
 public static void HasOutput(
     CodeExampleInfo codeExampleInfo,
     string expected)
 {
     Assert.AreEqual(expected: expected, actual: codeExampleInfo.Output);
 }
 public static void IsSuccessful(
     CodeExampleInfo codeExampleInfo)
 {
     Assert.IsNull(codeExampleInfo.Error);
     HasExitCode(codeExampleInfo, expected: 0);
 }
 public static void HasNotExitCode(
     CodeExampleInfo codeExampleInfo,
     int notExpected)
 {
     Assert.AreNotEqual(notExpected: notExpected, actual: codeExampleInfo.ExitCode);
 }
 public static void HasExitCode(
     CodeExampleInfo codeExampleInfo,
     int expected)
 {
     Assert.AreEqual(expected: expected, actual: codeExampleInfo.ExitCode);
 }