public struct TestCase

A test case that will be executed

Example

TestCase string representation should be a JSON string

void MockTest() {}

auto testCase = TestCase("some suite", "some name", &MockTest, [ Label("label1", "value1"), Label("label2", "value2") ]);
testCase.location = SourceLocation("file.d", 42);

testCase.toString.should.equal(`{ "suiteName": "some suite", "name": "some name", ` ~
  `"labels": [ { "name": "label1", "value": "value1" }, { "name": "label2", "value": "value2" } ], ` ~
  `"location": { "fileName": "file.d", "line": 42 } }`);

public string suiteName

The test case suite name. It can contain

.
which is treated as a separator for nested suites

public string name

The test name

public TestCaseDelegate func

The function that must be executed to check if the test passes or not. In case of failure, an exception is thrown.

public Label[] labels

A list of labels that will be added to the final report

public SourceLocation location

The test location

public this(const TestCase testCase)
public this(T)(
    string suiteName, 
    string name, 
    T func, 
    Label[] labels, 
    SourceLocation location)
public this(
    string suiteName, 
    string name, 
    TestCaseFunction func, 
    Label[] labels = [])
public this(
    string suiteName, 
    string name, 
    TestCaseDelegate func, 
    Label[] labels = [])