/// <summary> /// Tests a successful code example, defined /// in the default namespace, whose source code /// cannot be found. /// </summary> /// <remarks> /// <para> /// Source code files must be stored in a directory tree under a /// user defined folder, the <see cref="CodeExamplesAnalyzer.CodeBase"/>, /// reflecting the project namespace hierarchy. /// </para> /// <para> /// As a consequence, the source code for <see cref="CodeExample6"/> cannot /// be found since the file is in not in the expected directory. /// </para> /// </remarks> public static void TestCodeExample6(List <CodeExampleInfo> examples) { var exampleFullName = "Tests.CodeExamples.CodeExample6"; var example = Select(examples, exampleFullName); Assert.IsNotNull(example); CodeExampleInfoAssert.IsSuccessful(example); Assert.IsFalse(example.HasSourceCode); StringWriter writer = new StringWriter(); writer.WriteLine("CodeExample6:output"); CodeExampleInfoAssert.HasOutput(example, writer.ToString()); CodeExampleInfoAssert.HasNotOutputFile(example); }
/// <summary> /// Tests a faulted code example, defined /// in the default namespace, whose source code /// can be found. /// </summary> public static void TestCodeExample0(List <CodeExampleInfo> examples) { var exampleFullName = "Tests.CodeExamples.CodeExample0"; var example = Select(examples, exampleFullName); Assert.IsNotNull(example); CodeExampleInfoAssert.IsNotSuccessful(example); Assert.IsTrue(example.HasSourceCode); StringWriter writer = new StringWriter(); writer.Write("CodeExample0:error"); CodeExampleInfoAssert.HasError( example, writer.ToString()); CodeExampleInfoAssert.HasNotOutputFile(example); }