Table of Contents

Class Test

Namespace
Cuemon.Extensions.Xunit
Assembly
Cuemon.Extensions.Xunit.dll

Represents the base class from which all implementations of unit testing should derive.

public abstract class Test : Disposable, ITest, IDisposable
Inheritance
Object
Test
Implements
IDisposable
Derived
Inherited Members

Constructors

Test(ITestOutputHelper, Type)

Initializes a new instance of the Test class.

protected Test(ITestOutputHelper output = null, Type callerType = null)

Parameters

output ITestOutputHelper

An implementation of the Xunit.Abstractions.ITestOutputHelper interface.

callerType Type

The System.Type of caller that ends up invoking this instance.

Remarks

output is initialized automatically in an xUnit project.

Properties

CallerType

Gets the type of caller for this instance. Default is System.Object.GetType.

public Type CallerType { get; }

Property Value

Type

The type of caller for this instance.

HasTestOutput

Gets a value indicating whether TestOutput has a reference to an implementation of Xunit.Abstractions.ITestOutputHelper.

protected bool HasTestOutput { get; }

Property Value

Boolean

true if this instance has has a reference to an implementation of Xunit.Abstractions.ITestOutputHelper; otherwise, false.

TestOutput

Gets the console substitute to write out unit test information.

protected ITestOutputHelper TestOutput { get; }

Property Value

ITestOutputHelper

The console substitute to write out unit test information.

Methods

Match(String, String, Action<WildcardOptions>)

Provides a way, with wildcard support, to determine if actual matches expected.

public static bool Match(string expected, string actual, Action<WildcardOptions> setup = null)

Parameters

expected String

The expected string value.

actual String

The actual string value.

setup Action<WildcardOptions>

The WildcardOptions which may be configured.

Returns

Boolean

true if actual matches expected, false otherwise.

Remarks

Exceptions

System.ArgumentOutOfRangeException

expected cannot be matched with actual. Includes the non-matched string(s) in System.ArgumentOutOfRangeException.ActualValue.

OnDisposeManagedResources()

Called when this object is being disposed by either Dispose() or Dispose(Boolean) having disposing set to true and Disposed is false.

protected override void OnDisposeManagedResources()

See Also

Disposable
ITestOutputHelper