public class TestCase
A class TestCase describes an actual block of code that will be tested.
It contains a reference back to the interface Spec instance in which it
is being executed.
It also captures a closure of the body of the test case.
This is a function which is invoked with a class TestContext.
The context is used so that the test function can, at runtime,
register nested tests with the test engine. This allows
nested tests to be executed lazily as required, rather
than when the interface Spec instance is created.
A test can be nested inside other tests if the interface Spec supports it.
For example, in the FunSpec we only allow top level tests.
test("this is a test") { }
And in WordSpec we allow two levels of tests.
"a string" should { "return the length" { } }
| Modifier and Type | Class and Description |
|---|---|
static class |
TestCase.Companion |
| Modifier and Type | Field and Description |
|---|---|
static TestCase.Companion |
Companion |
| Constructor and Description |
|---|
TestCase(Description description,
Spec spec,
kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test,
SourceRef source,
TestType type,
TestCaseConfig config)
A
class TestCase describes an actual block of code that will be tested.
It contains a reference back to the interface Spec instance in which it
is being executed. |
| Modifier and Type | Method and Description |
|---|---|
Description |
component1() |
Spec |
component2() |
kotlin.jvm.functions.Function2<io.kotlintest.TestContext,kotlin.coroutines.experimental.Continuation,java.lang.Object> |
component3() |
SourceRef |
component4() |
TestType |
component5() |
TestCaseConfig |
component6() |
TestCase |
copy(Description description,
Spec spec,
kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test,
SourceRef source,
TestType type,
TestCaseConfig config)
A
class TestCase describes an actual block of code that will be tested.
It contains a reference back to the interface Spec instance in which it
is being executed. |
boolean |
equals(java.lang.Object p) |
TestCaseConfig |
getConfig() |
Description |
getDescription() |
int |
getLine() |
java.lang.String |
getName() |
SourceRef |
getSource() |
Spec |
getSpec() |
kotlin.jvm.functions.Function2<io.kotlintest.TestContext,kotlin.coroutines.experimental.Continuation,java.lang.Object> |
getTest() |
TestType |
getType() |
int |
hashCode() |
boolean |
isBang() |
boolean |
isFocused() |
boolean |
isTopLevel() |
java.lang.String |
toString() |
public static TestCase.Companion Companion
public TestCase(Description description, Spec spec, kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test, SourceRef source, TestType type, TestCaseConfig config)
A class TestCase describes an actual block of code that will be tested.
It contains a reference back to the interface Spec instance in which it
is being executed.
It also captures a closure of the body of the test case.
This is a function which is invoked with a class TestContext.
The context is used so that the test function can, at runtime,
register nested tests with the test engine. This allows
nested tests to be executed lazily as required, rather
than when the interface Spec instance is created.
A test can be nested inside other tests if the interface Spec supports it.
For example, in the FunSpec we only allow top level tests.
test("this is a test") { }
And in WordSpec we allow two levels of tests.
"a string" should { "return the length" { } }
public java.lang.String getName()
public boolean isFocused()
public boolean isTopLevel()
public boolean isBang()
public int getLine()
public Description getDescription()
public Spec getSpec()
public kotlin.jvm.functions.Function2<io.kotlintest.TestContext,kotlin.coroutines.experimental.Continuation,java.lang.Object> getTest()
public SourceRef getSource()
public TestType getType()
public TestCaseConfig getConfig()
public Description component1()
public Spec component2()
public kotlin.jvm.functions.Function2<io.kotlintest.TestContext,kotlin.coroutines.experimental.Continuation,java.lang.Object> component3()
public SourceRef component4()
public TestType component5()
public TestCaseConfig component6()
public TestCase copy(Description description, Spec spec, kotlin.jvm.functions.Function2<? super io.kotlintest.TestContext,? super kotlin.coroutines.experimental.Continuation<? super kotlin.Unit>,? extends java.lang.Object> test, SourceRef source, TestType type, TestCaseConfig config)
A class TestCase describes an actual block of code that will be tested.
It contains a reference back to the interface Spec instance in which it
is being executed.
It also captures a closure of the body of the test case.
This is a function which is invoked with a class TestContext.
The context is used so that the test function can, at runtime,
register nested tests with the test engine. This allows
nested tests to be executed lazily as required, rather
than when the interface Spec instance is created.
A test can be nested inside other tests if the interface Spec supports it.
For example, in the FunSpec we only allow top level tests.
test("this is a test") { }
And in WordSpec we allow two levels of tests.
"a string" should { "return the length" { } }
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)