TestMethodResult
classin packageklyn.unittest
public class TestMethodResult
TestMethodResult

Structured result of one execution of a method annotated with @Test. Data-driven executions have a one-based suffix, for example testAddition[2].

Example
import klyn.unittest

result = TestMethodResult("testAddition")
assert result.passed
Properties
Modifier and Type Member Description
public property durationMs
durationMs as Double = 0.0
Method execution duration in milliseconds.
public readonly property failures
failures as ArrayList<TestFailure>
Failures raised by this method.
public property name
name as String = ""
Test method name.
public readonly property passed
passed as Boolean
Indicates whether this method completed successfully.
public property status
status as String = TestStatus.PASSED
Canonical value from TestStatus.
Constructors
Modifier and Type Member Description
public TestMethodResult
TestMethodResult( name as String = "", status as String = TestStatus.PASSED, durationMs as Double = 0.0 )
Creates a method result.
Methods
Modifier and Type Member Description
public static fromMap
fromMap(data as Map<String, Object>) as TestMethodResult
Creates a typed method result from parsed JSON data.
public override toMap
toMap() as SortedMap<String, Object>
Converts this result to a JSON-compatible map.