ConsoleWriter

Overview

ConsoleWriter is a class hat is used to write results of a test run to console.

Use case

You can use this class to represent test result as string and output it to console:

    //locates all tests
    var Discovered := Discovery.DiscoverTests;
    //Executes tests
    var Completed := Runner.RunTests(Discovered);
    var Writer := new ConsoleWriter(Completed);
    Writer.WriteFull;
    Writer.WriteLine("=========");
    Writer.WriteSummary;

    Writer.OutputToConsole;

Location

  • Reference:
    • RemObjects.Elements.EUnit.dll  .NET, .NET Standard 2.0
    • remobjects.elements.eunit.jar  Cooper
    • EUnit.fx  Island, macOS
    • libEUnit.fx  Toffee
  • Namespace: RemObjects.Elements.EUnit
  • Platforms: .NET, .NET Standard 2.0, Cooper, Island, macOS, Toffee
  • Ancestry: BaseWriter | StringWriter | ConsoleWriter

 

constructor .NET, .NET Standard 2.0, Cooper, Island, macOS

Creates a new instance of the class with specified parameters.

 

constructor(TestResults: ITestResult)

 

ConsoleWriter(ITestResult TestResults)

 

init(_ TestResults: ITestResult)

 

ConsoleWriter(ITestResult TestResults)

 

Sub New(TestResults As ITestResult)

Parameters:

  • TestResults: Reference to a test result.

description  override    (declared in StringWriter) Toffee

 

func description(description ) -> NSString

Parameters:

  • :

Items  virtual    (declared in BaseWriter)

Gets reference to a test result assosiated with this writer.

 

property Items: ITestResult read;

 

ITestResult Items { get; }

 

var Items: ITestResult { get{} }

 

ITestResult Items { __get; }

 

ReadOnly Property Items() As ITestResult

Output  virtual    (declared in StringWriter)

Gets current text output.

 

property Output: String read;

 

String Output { get; }

 

var Output: String { get{} }

 

String Output { __get; }

 

ReadOnly Property Output() As String

OutputToConsole .NET, .NET Standard 2.0, Cooper, Island, macOS

Writes current output to console.

 

method OutputToConsole

 

void OutputToConsole()

 

func OutputToConsole()

 

void OutputToConsole()

 

Sub OutputToConsole()

OutputToConsole OutputToConsole()  virtual Toffee

 

func OutputToConsole(OutputToConsole )

Parameters:

  • :

toString    (declared in StringWriter) Cooper

 

PlatformString toString()

ToString  virtual    (declared in StringWriter) Toffee

 

func ToString(ToString ) -> String

Parameters:

  • :

Write  virtual    (declared in BaseWriter)

Writes all test results that matches the conditions defined by the specified predicate.

 

// .NET, .NET Standard 2.0, Island
method Write(Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
method Write(Filter: Predicate<ITestResult>)

 

// .NET, .NET Standard 2.0, Island
void Write(RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult> Filter)
// macOS
void Write(Predicate<ITestResult> Filter)

 

func Write(_ Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)

 

void Write(Predicate<ITestResult> Filter)

 

// .NET, .NET Standard 2.0, Island
Sub Write(Filter As RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
Sub Write(Filter As Predicate<ITestResult>)

Parameters:

  • Filter: Block that defines the conditions of the elements to search for.

WriteElement  protected virtual    (declared in StringWriter)

Writes specified elemet.

 

method WriteElement(Item: ITestResult)

 

void WriteElement(ITestResult Item)

 

func WriteElement(_ Item: ITestResult)

 

void WriteElement(ITestResult Item)

 

Sub WriteElement(Item As ITestResult)

Parameters:

  • Item: Element to write.

WriteFailed  virtual    (declared in BaseWriter)

Writes only tests that failed.

 

method WriteFailed(TestcaseOnly: Boolean)

 

void WriteFailed(Boolean TestcaseOnly)

 

func WriteFailed(_ TestcaseOnly: Boolean)

 

void WriteFailed(Boolean TestcaseOnly)

 

Sub WriteFailed(TestcaseOnly As Boolean)

Parameters:

  • TestcaseOnly: Value that indicates whether this method will write only testcases or all types of tests.

WriteFull    (declared in BaseWriter) .NET, .NET Standard 2.0, Cooper, Island, macOS

Writes full test result tree.

 

method WriteFull

 

void WriteFull()

 

func WriteFull()

 

void WriteFull()

 

Sub WriteFull()

WriteFull WriteFull()  virtual    (declared in BaseWriter) Toffee

 

func WriteFull(WriteFull )

Parameters:

  • :

WriteLine (String)  override    (declared in StringWriter)

 

method WriteLine(Item: String)

 

void WriteLine(String Item)

 

func WriteLine(_ Item: String)

 

void WriteLine(String Item)

 

Sub WriteLine(Item As String)

Parameters:

  • Item:

WriteLine (String)  virtual abstract    (declared in BaseWriter)

Writes specified line of text.

 

method WriteLine(Line: String)

 

void WriteLine(String Line)

 

func WriteLine(_ Line: String)

 

void WriteLine(String Line)

 

Sub WriteLine(Line As String)

Parameters:

  • Line: String that will be written.

WriteNode  protected override    (declared in StringWriter)

 

// .NET, .NET Standard 2.0, Island
method WriteNode(Node: ITestResult; Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
method WriteNode(Node: ITestResult; Filter: Predicate<ITestResult>)

 

// .NET, .NET Standard 2.0, Island
void WriteNode(ITestResult Node, RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult> Filter)
// macOS
void WriteNode(ITestResult Node, Predicate<ITestResult> Filter)

 

func WriteNode(_ Node: ITestResult, _ Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)

 

void WriteNode(ITestResult Node, Predicate<ITestResult> Filter)

 

// .NET, .NET Standard 2.0, Island
Sub WriteNode(Node As ITestResult, Filter As RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
Sub WriteNode(Node As ITestResult, Filter As Predicate<ITestResult>)

Parameters:

  • Node:
  • Filter:

WriteSuite  protected override    (declared in StringWriter)

Writes specified suite items.

 

method WriteSuite(Item: ITestResult)

 

void WriteSuite(ITestResult Item)

 

func WriteSuite(_ Item: ITestResult)

 

void WriteSuite(ITestResult Item)

 

Sub WriteSuite(Item As ITestResult)

Parameters:

  • Item: Reference to a test suite to write.

WriteSummary  virtual    (declared in BaseWriter)

Writes summary of the test run.

 

method WriteSummary(IncludeAll: Boolean)

 

void WriteSummary(Boolean IncludeAll)

 

func WriteSummary(_ IncludeAll: Boolean)

 

void WriteSummary(Boolean IncludeAll)

 

Sub WriteSummary(IncludeAll As Boolean)

Parameters:

  • IncludeAll: Value that indicates whether all items should be calculated or only tests and testcases.

WriteTest  protected override    (declared in StringWriter)

Writes specified test items.

 

method WriteTest(Item: ITestResult)

 

void WriteTest(ITestResult Item)

 

func WriteTest(_ Item: ITestResult)

 

void WriteTest(ITestResult Item)

 

Sub WriteTest(Item As ITestResult)

Parameters:

  • Item: Reference to a test to write.

WriteTestcase  protected override    (declared in StringWriter)

Writes specified testcase items.

 

method WriteTestcase(Item: ITestResult)

 

void WriteTestcase(ITestResult Item)

 

func WriteTestcase(_ Item: ITestResult)

 

void WriteTestcase(ITestResult Item)

 

Sub WriteTestcase(Item As ITestResult)

Parameters:

  • Item: Reference to a testcase to write.

 

Items  virtual    (declared in BaseWriter)

Gets reference to a test result assosiated with this writer.

 

property Items: ITestResult read;

 

ITestResult Items { get; }

 

var Items: ITestResult { get{} }

 

ITestResult Items { __get; }

 

ReadOnly Property Items() As ITestResult

Output  virtual    (declared in StringWriter)

Gets current text output.

 

property Output: String read;

 

String Output { get; }

 

var Output: String { get{} }

 

String Output { __get; }

 

ReadOnly Property Output() As String

 

constructor .NET, .NET Standard 2.0, Cooper, Island, macOS

Creates a new instance of the class with specified parameters.

 

constructor(TestResults: ITestResult)

 

ConsoleWriter(ITestResult TestResults)

 

init(_ TestResults: ITestResult)

 

ConsoleWriter(ITestResult TestResults)

 

Sub New(TestResults As ITestResult)

Parameters:

  • TestResults: Reference to a test result.

description  override    (declared in StringWriter) Toffee

 

func description(description ) -> NSString

Parameters:

  • :

OutputToConsole .NET, .NET Standard 2.0, Cooper, Island, macOS

Writes current output to console.

 

method OutputToConsole

 

void OutputToConsole()

 

func OutputToConsole()

 

void OutputToConsole()

 

Sub OutputToConsole()

OutputToConsole OutputToConsole()  virtual Toffee

 

func OutputToConsole(OutputToConsole )

Parameters:

  • :

toString    (declared in StringWriter) Cooper

 

PlatformString toString()

ToString  virtual    (declared in StringWriter) Toffee

 

func ToString(ToString ) -> String

Parameters:

  • :

Write  virtual    (declared in BaseWriter)

Writes all test results that matches the conditions defined by the specified predicate.

 

// .NET, .NET Standard 2.0, Island
method Write(Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
method Write(Filter: Predicate<ITestResult>)

 

// .NET, .NET Standard 2.0, Island
void Write(RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult> Filter)
// macOS
void Write(Predicate<ITestResult> Filter)

 

func Write(_ Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)

 

void Write(Predicate<ITestResult> Filter)

 

// .NET, .NET Standard 2.0, Island
Sub Write(Filter As RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
Sub Write(Filter As Predicate<ITestResult>)

Parameters:

  • Filter: Block that defines the conditions of the elements to search for.

WriteElement  protected virtual    (declared in StringWriter)

Writes specified elemet.

 

method WriteElement(Item: ITestResult)

 

void WriteElement(ITestResult Item)

 

func WriteElement(_ Item: ITestResult)

 

void WriteElement(ITestResult Item)

 

Sub WriteElement(Item As ITestResult)

Parameters:

  • Item: Element to write.

WriteFailed  virtual    (declared in BaseWriter)

Writes only tests that failed.

 

method WriteFailed(TestcaseOnly: Boolean)

 

void WriteFailed(Boolean TestcaseOnly)

 

func WriteFailed(_ TestcaseOnly: Boolean)

 

void WriteFailed(Boolean TestcaseOnly)

 

Sub WriteFailed(TestcaseOnly As Boolean)

Parameters:

  • TestcaseOnly: Value that indicates whether this method will write only testcases or all types of tests.

WriteFull    (declared in BaseWriter) .NET, .NET Standard 2.0, Cooper, Island, macOS

Writes full test result tree.

 

method WriteFull

 

void WriteFull()

 

func WriteFull()

 

void WriteFull()

 

Sub WriteFull()

WriteFull WriteFull()  virtual    (declared in BaseWriter) Toffee

 

func WriteFull(WriteFull )

Parameters:

  • :

WriteLine (String)  override    (declared in StringWriter)

 

method WriteLine(Item: String)

 

void WriteLine(String Item)

 

func WriteLine(_ Item: String)

 

void WriteLine(String Item)

 

Sub WriteLine(Item As String)

Parameters:

  • Item:

WriteLine (String)  virtual abstract    (declared in BaseWriter)

Writes specified line of text.

 

method WriteLine(Line: String)

 

void WriteLine(String Line)

 

func WriteLine(_ Line: String)

 

void WriteLine(String Line)

 

Sub WriteLine(Line As String)

Parameters:

  • Line: String that will be written.

WriteNode  protected override    (declared in StringWriter)

 

// .NET, .NET Standard 2.0, Island
method WriteNode(Node: ITestResult; Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
method WriteNode(Node: ITestResult; Filter: Predicate<ITestResult>)

 

// .NET, .NET Standard 2.0, Island
void WriteNode(ITestResult Node, RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult> Filter)
// macOS
void WriteNode(ITestResult Node, Predicate<ITestResult> Filter)

 

func WriteNode(_ Node: ITestResult, _ Filter: RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)

 

void WriteNode(ITestResult Node, Predicate<ITestResult> Filter)

 

// .NET, .NET Standard 2.0, Island
Sub WriteNode(Node As ITestResult, Filter As RemObjects.Elements.RTL.Predicate<RemObjects.Elements.EUnit.ITestResult>)
// macOS
Sub WriteNode(Node As ITestResult, Filter As Predicate<ITestResult>)

Parameters:

  • Node:
  • Filter:

WriteSuite  protected override    (declared in StringWriter)

Writes specified suite items.

 

method WriteSuite(Item: ITestResult)

 

void WriteSuite(ITestResult Item)

 

func WriteSuite(_ Item: ITestResult)

 

void WriteSuite(ITestResult Item)

 

Sub WriteSuite(Item As ITestResult)

Parameters:

  • Item: Reference to a test suite to write.

WriteSummary  virtual    (declared in BaseWriter)

Writes summary of the test run.

 

method WriteSummary(IncludeAll: Boolean)

 

void WriteSummary(Boolean IncludeAll)

 

func WriteSummary(_ IncludeAll: Boolean)

 

void WriteSummary(Boolean IncludeAll)

 

Sub WriteSummary(IncludeAll As Boolean)

Parameters:

  • IncludeAll: Value that indicates whether all items should be calculated or only tests and testcases.

WriteTest  protected override    (declared in StringWriter)

Writes specified test items.

 

method WriteTest(Item: ITestResult)

 

void WriteTest(ITestResult Item)

 

func WriteTest(_ Item: ITestResult)

 

void WriteTest(ITestResult Item)

 

Sub WriteTest(Item As ITestResult)

Parameters:

  • Item: Reference to a test to write.

WriteTestcase  protected override    (declared in StringWriter)

Writes specified testcase items.

 

method WriteTestcase(Item: ITestResult)

 

void WriteTestcase(ITestResult Item)

 

func WriteTestcase(_ Item: ITestResult)

 

void WriteTestcase(ITestResult Item)

 

Sub WriteTestcase(Item As ITestResult)

Parameters:

  • Item: Reference to a testcase to write.