C# Class NArrange.Tests.CSharp.CSharpTestFile

C# test file information.
Inheritance: ISourceCodeTestFile
Show file Open project: MarcStan/NArrange Class Usage Examples

Public Methods

Method Description
CSharpTestFile ( string resourceName, bool targetCSharp6 = false ) : System.CodeDom.Compiler

Creates a new test file using the specified resource.

Compile ( string source, bool targetCSharp6 = false ) : CompilerResults

Compiles C# source code.

GetReader ( ) : TextReader

Gets a TextReader for this test file.

GetTestFileReader ( string resourceName ) : TextReader

Retrieves a reader for the specified resource.

GetTestFileStream ( string resourceName ) : Stream

Opens a test file resource stream.

Private Methods

Method Description
GetAssembly ( string resourceName, bool targetCSharp6 = false ) : Assembly

Gets the assembly.

Method Details

CSharpTestFile() public method

Creates a new test file using the specified resource.
public CSharpTestFile ( string resourceName, bool targetCSharp6 = false ) : System.CodeDom.Compiler
resourceName string Name of the resource.
targetCSharp6 bool Set to true if C# 6 features are used. This will use the new Microsoft CodeDomCompiler, otherwise the old one is used.
return System.CodeDom.Compiler

Compile() public static method

Compiles C# source code.
public static Compile ( string source, bool targetCSharp6 = false ) : CompilerResults
source string The source.
targetCSharp6 bool
return System.CodeDom.Compiler.CompilerResults

GetReader() public method

Gets a TextReader for this test file.
public GetReader ( ) : TextReader
return TextReader

GetTestFileReader() public static method

Retrieves a reader for the specified resource.
public static GetTestFileReader ( string resourceName ) : TextReader
resourceName string Name of the resource.
return TextReader

GetTestFileStream() public static method

Opens a test file resource stream.
public static GetTestFileStream ( string resourceName ) : Stream
resourceName string Name of the resource.
return System.IO.Stream