Skip to content

VinTest.TestChain

VinTest

TestChain Class

Builder for a sequence of TestSteps that make up a test method.

public class TestChain : IEnumerable<VinTest.TestStep>, IEnumerable

Inheritance Object → TestChain

Implements IEnumerable<TestStep>, IEnumerable

Methods

TestChain.Assert(string, Func<bool>, string, int) Method

Evaluates condition and records the result under name. Source location is captured automatically for clickable output on failure.

public VinTest.TestChain Assert(string name, Func<bool> condition, string file="", int line=0);

Parameters

name String

condition Func<Boolean>

file String

line Int32

Returns

TestChain

TestChain.AssertEventually(string, int, Func<bool>, int, string, int) Method

Polls breakWhen every pollIntervalMs milliseconds until it returns true or maxMs have elapsed.

public VinTest.TestChain AssertEventually(string name, int maxMs, Func<bool> breakWhen, int pollIntervalMs=500, string file="", int line=0);

Parameters

name String

maxMs Int32

breakWhen Func<Boolean>

pollIntervalMs Int32

file String

line Int32

Returns

TestChain

TestChain.Do(Action) Method

Executes action synchronously; fails the test on exception.

public VinTest.TestChain Do(Action action);

Parameters

action Action

Returns

TestChain

TestChain.Wait(int) Method

Delays next steps for ms milliseconds before continuing.

public VinTest.TestChain Wait(int ms);

Parameters

ms Int32

Returns

TestChain

TestChain.WaitIf(int, Func<bool>) Method

If condition is true at when step executes, delays next steps for ms milliseconds. Otherwise, skip the wait and proceed immediately.

public VinTest.TestChain WaitIf(int ms, Func<bool> condition);

Parameters

ms Int32

condition Func<Boolean>

Returns

TestChain