Class
class AssertionCtx
public class AssertionCtx
Description: Stores the status of custom assertions. Provides methods for writing custom assertions.
prop args
public prop args: String
Description: Returns a string of unparsed custom assertion parameters separated by commas (,).
Type: String
prop caller
public prop caller: String
Description: Obtains the identifier of the custom assertion function.
Type: String
prop hasErrors
public prop hasErrors: Bool
Description: Returns true if any custom assertion fails. Otherwise, returns false.
Type: Bool
func arg(String)
public func arg(key: String): String
Description: Returns the string expression of the parameter value representing the originally passed identifier, which matches the identifier in the parameter list.
Parameters:
- key: String: identifier in the function parameter list
Returns:
- String: string expression of the parameter value of the corresponding identifier
func fail(String)
public func fail(message: String): Nothing
Description: Stores the failure message, provides the message in the custom assertion function, and throws AssertExpection.
Parameters:
- message: String: failure message
func fail<PP>(PP)
public func fail<PP>(pt: PP): Nothing where PP <: PrettyPrintable
Description: Stores the failure message, provides the message in the custom assertion function, and throws AssertExpection.
Parameters:
- pt: PP <: PrettyPrintable: failure message
func failExpect(String)
public func failExpect(message: String): Unit
Description: Stores the failure message, provides the message in the custom assertion function, and continues to execute the function.
Parameters:
- message: String: failure message
func failExpect<PP>(PP)
public func failExpect<PP>(pt: PP): Unit where PP <: PrettyPrintable
Description: Stores the failure message, provides the message in the custom assertion function, and continues to execute the function.
Parameters:
- pt: PP <: PrettyPrintable: failure message
func setArgsAliases(Array<String>)
public func setArgsAliases(aliases: Array<String>): Unit
Description: Sets an alias to access parameters of the unparsed custom assertion function using the arg function. This function is used inside the framework and you do not need to use the function.
Parameters:
- aliases: Array<String>: identifier array. The array size needs to match the parameter list (except
AssertionCtx).
class Benchmark
public class Benchmark {}
Description: Provides methods for creating and running individual performance test cases.
prop name
public prop name: String
Description: Obtains the name of a test case.
Type: String
func run()
public func run(): BenchReport
Description: Runs the performance test case.
Returns:
- BenchReport: running result report
static func create(String, Configuration, () -> Unit)
public static func create(name: String, configuration!: Configuration = Configuration(), body!: () -> Unit): Benchmark
Description: Creates a performance test case object.
Parameters:
- name: String: case name
- configuration!: Configuration: test case configuration information
- body!: () -> Unit: test case executor
Returns:
- Benchmark: performance test case object
static func createParameterized<T>(String, DataStrategy<T>, Configuration, (T) -> Unit)
public static func createParameterized<T>(name: String, strategy: DataStrategy<T>, configuration!: Configuration = Configuration(), body!: (T) -> Unit): Benchmark
Description: Creates a parameterized performance test case object.
Parameters:
- name: String: case name
- strategy: DataStrategy: parameter data strategy
- configuration!: Configuration: test case configuration information
- body!: () -> Unit: test case executor
Returns:
- Benchmark: performance test case object
static func createParameterized<T>(String, DataStrategyProcessor<T>, Configuration, (T) -> Unit)
public static func createParameterized<T>(name: String, strategy: DataStrategyProcessor<T>, configuration!: Configuration = Configuration(), body!: (T) -> Unit): Benchmark
Description: Creates a parameterized performance test case object.
Parameters:
- name: String: case name
- strategy: DataStrategyProcessor: parameter data processor
- configuration!: Configuration: test case configuration information
- body!: () -> Unit: test case executor
Returns:
- Benchmark: performance test case object
class BenchReport
public class BenchReport <: Report {}
Description: Provides capabilities for handling performance test case execution result reports.
Parent types:
func reportTo<T>(Reporter<BenchReport, T>)
public func reportTo<T>(reporter: Reporter<BenchReport, T>): T
Description: Prints the performance test case result report.
Parameters:
- reporter: Reporter<BenchReport, T>: performance test case result report
Returns:
- T: the result printed. Generally the value is of the Unit type.
class CartesianProductProcessor
public class CartesianProductProcessor<T0,T1> <: DataStrategyProcessor<(T0,T1)> {}
Description: Specifies a Cartesian product processor.
Parent types:
- DataStrategyProcessor<(T0, T1)>
init(DataStrategyProcessor<T0>, DataStrategyProcessor<T1>)
public CartesianProductProcessor(let left: DataStrategyProcessor<T0>, let right: DataStrategyProcessor<T1>)
Description: Specifies a constructor.
Parameters:
- left: DataStrategyProcessor<T0>: data strategy processor
- right: DataStrategyProcessor<T1>: data strategy processor
class ConsoleReporter
public class ConsoleReporter <: Reporter<TestReport, Unit> & Reporter<BenchReport, Unit>{
public ConsoleReporter(let colored!: Bool = true)
}
Description: Prints the unit test case results or performance test case results to the console.
Parent types:
init(Bool)
public ConsoleReporter(let colored!: Bool = true)
Description: Specifies a constructor.
Parameters:
- colored!: Bool: Specifies whether colored printing is used. By default, colored printing is used.
class TextReporter
public class TextReporter<PP> <: Reporter<TestReport, PP> & Reporter<BenchReport, PP>
where PP <: PrettyPrinter {
public TextReporter(let into!: PP)
}
Description: Prints the unit test case result or performance test result to the subclass of PrettyPrinter. The format is the same as that of ConsoleReporter.
Parent types:
- Reporter<TestReport, PP>
- Reporter<BenchReport, PP>
init(PP)
public TextReporter(let into!: PP)
Description: Specifies a constructor.
Parameters:
- into!: PP: report printing subclass of PrettyPrinter.
class CsvReporter
public class CsvReporter <: Reporter<BenchReport, Unit> {
public CsvReporter(let directory: Path)
}
Description: Prints the performance test case results to a CSV file.
Parent types:
init(Path)
public CsvReporter(let directory: Path)
Description: Specifies a constructor.
Parameters:
- directory: Path: directory where the printed file is generated
class CsvRawReporter
public class CsvRawReporter <: Reporter<BenchReport, Unit> {
public CsvRawReporter(let directory: Path)
}
Description: Prints the performance test case results, which contain only a batch of raw measurement data, to a CSV file.
Parent types:
init(Path)
public CsvRawReporter(let directory: Path)
Description: Specifies a constructor.
Parameters:
- directory: Path: directory where the printed file is generated
class CsvStrategy
public class CsvStrategy<T> <: DataStrategy<T> where T <: Serializable<T> {}
Description: Indicates serialization implementation by DataStrategy on the CSV data format.
Parent types:
- DataStrategy<T>
func provider(Configuration)
public override func provider(configuration: Configuration): SerializableProvider<T>
Description: Generates a serialized data iterator.
Parameters:
- configuration: Configuration: data configuration information
Returns:
- SerializableProvider<T>: serialized iterator object
class DataStrategyProcessor
abstract sealed class DataStrategyProcessor<T> {}
Description: Specifies a base class for all DataStrategy components. Instances of this class are created by the @Strategy macro or member function.
prop isInfinite
protected prop isInfinite: Bool
Description: Checks whether the strategy is infinite.
Type: Bool
func intoBenchmark(String, Configuration, (T, Int64, Int64) -> Float64)
public func intoBenchmark(
caseName!: String,
configuration!: Configuration,
doRun!: (T, Int64, Int64) -> Float64
): Benchmark
Description: Specifies an auxiliary function used by the code generated by the macro. It is used to create performance test cases that use the strategy.
Parameters:
- caseName!: String: test case name
- configuration!: Configuration: configuration information
- doRun!: (T, Int64, Int64) -> Float64: performance test case executor
Returns:
- Benchmark: performance test case object
func intoUnitTestCase(String, Configuration, (T) -> Unit)
public func intoUnitTestCase(
caseName!: String,
configuration!: Configuration,
doRun!: (T) -> Unit
): UnitTestCase
Description: Specifies an auxiliary function used by the code generated by the macro. It is used to create test cases that use the strategy.
Parameters:
- caseName!: String: test case name
- configuration!: Configuration: configuration information
- doRun!: (T) -> Unit: performance test case executor
Returns:
- UnitTestCase: test case object
func lastItemInfo()
protected func lastItemInfo(): Array<InputParameter>
Description: Obtains the information about the last handled item.
Returns:
- Array<InputParameter>: information about the last handled item
func lastItem(Configuration)
protected func lastItem(configuration: Configuration): T
Description: Obtains the last handled item.
Parameters:
- configuration: Configuration: configuration information of the handling strategy
Returns:
- T: last handled item
func provide(Configuration)
protected func provide(configuration: Configuration): Iterable<T>
Description: Generates a data iterator based on the configuration information and data strategy.
Parameters:
- configuration: Configuration: configuration information of the handling strategy
Returns:
- Iterable<T>: data iterators
func shrinkLastItem(Configuration, LazyCyclicNode)
protected func shrinkLastItem(configuration: Configuration, engine: LazyCyclicNode): Iterable<T>
Description: Shrinks the last item.
Parameters:
- configuration:Configuration: configuration information
- engine: LazyCyclicNode: lazy node
Returns:
- Iterable<T>: data iterator after shrinking
static func start(DataStrategy<T>, String)
public static func start(s: DataStrategy<T>, name: String): SimpleProcessor<T>
Description: Specifies a start point for the composition and mapping of DataStrategy.
Parameters:
- s: DataStrategy<T>: data strategy
- name: String: case name
Returns:
- SimpleProcessor<T>: test case processor
static func start<U>(() -> DataStrategy<U>, String)
public static func start<U>(f: () -> DataStrategy<U>, name: String): DataStrategyProcessor<U> where U <: BenchInputProvider < T >
Description: Specifies a start point for the composition and mapping of DataStrategy.
Parameters:
- s: () -> DataStrategy<U>: closure generating the data strategy
- name: String: case name
Returns:
- DataStrategyProcessor<T>: data strategy processor
static func start(() -> DataStrategy<T>, String, Int64)
public static func start(f: () -> DataStrategy<T>, name: String, x!: Int64 = 0): SimpleProcessor<T>
Description: Specifies a start point for the composition and mapping of DataStrategy.
Parameters:
- s: () -> DataStrategy<T>: closure generating the data strategy
- name: String: case name
- x!: Int64: parameter added to reconstruct different return values
Returns:
- SimpleProcessor<T>: test case processor
static func start(() -> DataStrategyProcessor<T>, String)
public static func start(f: () -> DataStrategyProcessor<T>, name: String): DataStrategyProcessor<T>
Description: Specifies a start point for the composition and mapping of DataStrategy.
Parameters:
- s: () -> DataStrategyProcessor<T>: closure generating the data strategy processor
- name: String: case name
Returns:
- DataStrategyProcessor<T>: data strategy processor
static func start<U>(() -> DataStrategyProcessor<U>, String, Int64)
public static func start<U>(f: () -> DataStrategyProcessor<U>, name: String, x!: Int64 = 0):
DataStrategyProcessor<U> where U <: BenchInputProvider<T>
Description: Specifies a start point for the composition and mapping of DataStrategy.
Parameters:
- s: () -> DataStrategyProcessor<U>: closure generating the data strategy processor
- name: String: case name
- x!: Int64: parameter added to reconstruct different return values
Returns:
- DataStrategyProcessor<U> where U <: BenchInputProvider<T>: data strategy processor
extend <T> DataStrategyProcessor<T>
extend <T> DataStrategyProcessor<T> {}
func map<R>((T) -> R)
public func map<R>(f: (T) -> R): MapProcessor<T, R>
Description: Simply applies f to each item of the original data strategy. Shrink also occurs on the original input before mapping.
Parameters:
- f: (T) -> R: processing logic function to be applied
Returns:
- MapProcessor<T, R>: processor with
fapplied
func mapWithConfig<R>((T, Configuration) -> R)
public func mapWithConfig<R>(f: (T, Configuration) -> R): MapProcessor<T, R>
Description: Allows access to the current Configuration and applies f to each item of the original data strategy. Shrink also occurs on the original input before mapping.
Parameters:
- f: (T, Configuration) -> R: processing logic function to be applied
Returns:
- MapProcessor<T, R>: processor with
fapplied
func flatMap<R>((T) -> DataProvider<R>)
public func flatMap<R>(f: (T) -> DataProvider<R>): FlatMapProcessor<T, R>
Description: Simply applies f to each item of the original data strategy, and then flattens the result. Shrink also occurs on the original input before flatMap is applied.
Parameters:
- f: (T) -> DataProvider<R>: processing logic function to be applied
Returns:
- FlatMapProcessor<T, R>: processor with
fapplied
func flatMapStrategy((T) -> DataStrategy<R>)
public func flatMapStrategy<R>(f: (T) -> DataStrategy<R>): FlatMapStrategyProcessor<T, R>
Description: Simply applies f to each item of the original data strategy, and then flattens the result. Shrink is completed through the returned strategy rather than the original input.
Parameters:
- f: (T) -> DataStrategy<R>: processing logic function to be applied
Returns:
- FlatMapStrategyProcessor<T, R>: processor with
fapplied
func product(DataStrategyProcessor<R>)
public func product<R>(p: DataStrategyProcessor<R>): CartesianProductProcessor<T, R>
Description: Indicates a data strategy created by the Cartesian product combiner that contains all possible permutations of elements in the original strategy. For an infinite strategy, it iterates over all finite sub-strategies before advancing the infinite sub-policies. Shrink occurs independently and uniformly on each element of the original strategy.
Parameters:
- p: DataStrategyProcessor<R>: data strategy processor
Returns:
- CartesianProductProcessor<T, R>: Cartesian product processor
class FlatMapProcessor
public class FlatMapProcessor<T,R> <: DataStrategyProcessor<R> {}
Description: Specifies a processor applying FlatMap on parameter data.
Parent types:
class FlatMapStrategyProcessor
public class FlatMapStrategyProcessor<T,R> <: DataStrategyProcessor<R> {}
Description: Specifies a processor applying FlatMap on parameter data.
Parent types:
class InputParameter
public class InputParameter {}
Description: Specifies an input parameter object type.
class JsonStrategy
public class JsonStrategy<T> <: DataStrategy<T> where T <: Serializable<T> {}
Description: Indicates serialization implementation by DataStrategy on the JSON data format.
Parent types:
- DataStrategy<T>
func provider(Configuration)
public override func provider(configuration: Configuration): SerializableProvider<T>
Description: Generates a serialized data iterator.
Parameters:
- configuration: Configuration: data configuration information
Returns:
- SerializableProvider<T>: serialized iterator object
class LazyCyclicNode
public open class LazyCyclicNode {}
Description: Specifies an internal lazy iterator used to advance type erasure one after another in a loop.
func advance()
protected open func advance(): ?Unit
Description: Advances by one value.
Returns:
- ?Unit: If advancement cannot be made, None is returned; otherwise, Unit is returned.
func recover()
protected open func recover(): Unit
Description: Restores or moves back by one value.
class MapProcessor
public class MapProcessor<T,R> <: DataStrategyProcessor<R> {}
Description: Specifies a processor for handling parameter data with Map.
Parent types:
class PowerAssertDiagramBuilder
public class PowerAssertDiagramBuilder {
public init(expression: String)
}
Description: Specifies a constructor of the PowerAssert output result.
init(String, Int64)
public init(expression: String)
Description: Specifies a constructor.
Parameters:
- expression: String: expression string
func r<T>(T, String, Int64)
public func r<T>(value: T, exprAsText: String, position: Int64): T
Description: Records comparison data.
Parameters:
- value: T: data being recorded
- exprAsText: String: expression string
- position: Int64: position information
Returns:
- T: data being recorded
func r(String, String, Int64)
public func r(value: String, exprAsText: String, position: Int64): String
Description: Records comparison data.
Parameters:
- value: String: data being recorded
- exprAsText: String: expression string
- position: Int64: position information
Returns:
- String: recorded data
func r(Rune, String, Int64)
public func r(value: Rune, exprAsText: String, position: Int64): Rune
Description: Records comparison data.
Parameters:
- value: Rune: data being recorded
- exprAsText: String: expression string
- position: Int64: position information
Returns:
- Rune: data being recorded
func h(Exception, String, Int64)
public func h(exception: Exception, exprAsText: String, position: Int64): Nothing
Description: Handles exceptions.
Parameters:
- exception: Exception: exception to be handled
- exprAsText: String: expression string
- position: Int64: position information
func w(Bool)
public func w(passed: Bool): Unit
Description: Returns a success result if the test case is passed; throws an exception and prints the comparison result if it fails.
Parameters:
- passed: Bool: whether the test case is passed
class RandomDataProvider
public class RandomDataProvider<T> <: DataProvider<T> where T <: Arbitrary<T> {
public RandomDataProvider(private let configuration: Configuration)
}
Description: Implements the DataProvider interface generated by random data.
Parent types:
- DataProvider<T>
init(Configuration)
public RandomDataProvider(private let configuration: Configuration)
Description: Constructs an object for the random data provider.
Parameters:
- configuration: Configuration: configuration object, which must contain a random generator named
random, of type random.Random.
Throws:
- IllegalArgumentException: When the configuration does not contain a random instance, this exception is thrown.
prop isInfinite
public override prop isInfinite: Bool
Description: Specifies whether infinite data is generated.
Type: Bool
func provide()
public override func provide(): Iterable<T>
Description: Provides randomly generated data.
Returns:
- Iterable<T>: infinite iterator created from arbitrary instances of T
class RandomDataShrinker
public class RandomDataShrinker<T> <: DataShrinker<T> {}
Description: Indicates DataShrinker implementation generated using random data.
Parent types:
- DataShrinker<T>
func shrinker(T)
public override func shrink(value: T): Iterable<T>
Description: Obtains the shrinker for the value.
Parameters:
- value: T: parameter value
Returns:
- Iterable<T>: If the parameter implements the Shrink interface, an iterator of the shrunk values is returned. If not, an empty array is returned.
class RandomDataStrategy
public class RandomDataStrategy<T> <: DataStrategy<T> where T <: Arbitrary<T>{}
Description: Indicates DataStrategy implementation generated using random data.
Parent types:
- DataStrategy<T>
func provider(Configuration)
public override func provider(configuration: Configuration): RandomDataProvider<T>
Description: Obtains the provider of random data.
Parameters:
- configuration: Configuration: parameter configuration information
Returns:
- RandomDataProvider: random data provider
func shrinker(Configuration)
public override func shrinker(_: Configuration): RandomDataShrinker<T>
Description: Obtains the shrinker for random data.
Parameters:
- _: Configuration: parameter configuration information
Returns:
- RandomDataShrinker: random data shrinker
class Report
sealed abstract class Report {}
Description: Specifies a base class for printing test case result reports.
prop errorCount
public prop errorCount: Int64
Description: Obtains the number of test cases with errors.
Type: Int64
prop caseCount
public prop caseCount: Int64
Description: Obtains the number of test cases.
Type: Int64
prop passedCount
public prop passedCount: Int64
Description: Obtains the number of passed test cases.
Type: Int64
prop failedCount
public prop failedCount: Int64
Description: Obtains the number of failed test cases.
Type: Int64
prop skippedCount
public prop skippedCount: Int64
Description: Obtains the number of skipped test cases.
Type: Int64
class RawStatsReporter
public class RawStatsReporter <: Reporter<BenchReport, HashMap<String, (Float64, Float64)>> {
public RawStatsReporter()
}
Description: Reports raw performance test data. It is used only in the framework.
Parent types:
init()
public RawStatsReporter()
Description: Specifies a constructor.
class SerializableProvider
public class SerializableProvider<T> <: DataProvider<T> where T <: Serializable<T> {}
Description: Implements the DataProvider interface for obtaining serialized data.
Parent types:
- DataProvider<T>
prop isInfinite
public prop isInfinite: Bool
Description: Specifies whether infinite data is generated.
func provide()
public override func provide(): Iterable<T>
Description: Obtains the data iterator.
Returns:
- Iterable<T>: data iterator
class SimpleProcessor
public class SimpleProcessor<T> <: DataStrategyProcessor<T> {}
Description: Indicates simple data strategy processor implementation of DataStrategyProcessor.
Parent types:
init(() -> DataStrategy<T>, String)
public SimpleProcessor(let buildDelegate:() -> DataStrategy<T>, let name: String)
Description: Specifies a constructor.
Parameters:
- buildDelegate: () -> DataStrategy<T>: closure generating the data strategy
- name: String: processor name
class TestGroup
public class TestGroup {}
Description: Provides methods for building and running test groups.
prop name
public prop name: String
Description: Obtains the name of a test group.
Type: String
func runBenchmarks()
public func runBenchmarks(): BenchReport
Description: Runs all performance test cases.
Returns:
- BenchReport: performance test case report
func runBenchmarks(Configuration)
public func runBenchmarks(Configuration): BenchReport
Description: Executes all performance test cases with running configurations.
Parameters:
- configuration: Configuration: running configuration
Returns:
- BenchReport: performance test case report
func runTests()
public func runTests(): TestReport
Description: Executes all unit test cases.
Returns:
- TestReport: unit test case report
func runTests(Configuration)
public func runTests(configuration: Configuration): TestReport
Description: Executes all unit test cases with running configurations.
Parameters:
- configuration: Configuration: running configuration
Returns:
- TestReport: unit test case report
static func builder(String)
public static func builder(name: String): TestGroupBuilder
Description: Creates a test group builder.
Parameters:
- name: String: test group name
Returns:
- TestGroupBuilder: test group builder
static func builder(TestGroup)
public static func builder(group: TestGroup): TestGroupBuilder
Description: Creates a test group builder.
Parameters:
- group: TestGroup: test group
Returns:
- TestGroupBuilder: test group builder
class TestGroupBuilder
public class TestGroupBuilder {}
Description: Provides methods for configuring test groups.
func add(Benchmark)
public func add(benchmark: Benchmark): TestGroupBuilder
Description: Adds performance test cases for the test group.
Parameters:
- benchmark: Benchmark: performance test case
Returns:
- TestGroupBuilder: test group builder
func add(TestSuite)
public func add(suite: TestSuite): TestGroupBuilder
Description: Adds a unit test suite for a test group.
Parameters:
- suite: TestSuite: unit test suite
Returns:
- TestGroupBuilder: test group builder
func add(UnitTestCase)
public func add(test: UnitTestCase): TestGroupBuilder
Description: Adds unit test cases for the test group.
Parameters:
- test: UnitTestCase: unit test case
Returns:
- TestGroupBuilder: test group builder
func build()
public func build(): TestGroup
Description: Builds test group objects after the configuration is complete.
Returns:
- TestGroup: test group
func configure(Configuration)
public func configure(configuration: Configuration): TestGroupBuilder
Description: Configures the configuration information for the test group.
Parameters:
- configuration: Configuration: configuration information
Returns:
- TestGroupBuilder: test group builder
func setName(String)
public func setName(name: String): TestGroupBuilder
Description: Sets a name for the test group.
Parameters:
- name: String: name
Returns:
- TestGroupBuilder: test group builder
class TestPackage
public class TestPackage {
public TestPackage(let name: String)
}
Description: Specifies a test case package object.
init(String)
public TestPackage(let name: String)
Description: Specifies a constructor.
Parameters:
- name: String: test case package name
func registerCase(() -> UnitTestCase)
public func registerCase(testCase: () -> UnitTestCase): Unit
Description: Registers unit test cases.
Parameters:
- testCase: () -> UnitTestCase: closure generating unit test cases
func registerSuite(() -> TestSuite)
public func registerSuite(suite: () -> TestSuite): Unit
Description: Registers a test suite.
Parameters:
- suite: () -> TestSuite: closure generating the test suite
func registerBench(() -> Benchmark)
public func registerBench(bench: () -> Benchmark): Unit
Description: Registers performance test cases.
Parameters:
- bench: () -> Benchmark: closure generating performance test cases
class TestReport
public class TestReport <: Report {}
Description: Reports the unit test result.
Parent types:
func reportTo<T>(Reporter<TestReport, T>)
public func reportTo<T>(reporter: Reporter<TestReport, T>): T
Description: Prints the unit test execution report.
Parameters:
- reporter: Reporter<TestReport, T>: printer for unit test reports
Returns:
- T: Unit
class TestSuite
public class TestSuite {}
Description: Provides methods for building and executing test suites.
prop name
public prop name: String
Description: Obtains the name of a test suite.
Type: String
func runBenchmarks()
public func runBenchmarks(): BenchReport
Description: Runs all performance test cases.
Returns:
- BenchReport: performance test result
func runBenchmarks(Configuration)
public func runBenchmarks(configuration: Configuration): BenchReport
Description: Runs all performance test cases with configuration information.
Parameters:
- configuration: Configuration: running configuration information
Returns:
- BenchReport: running results of the performance test cases
func runTests()
public func runTests(): TestReport
Description: Runs the test suite.
Returns:
- TestReport: running result of the test suite
func runTests(Configuration)
public func runTests(configuration: Configuration): TestReport
Description: Runs the test suite with configuration information.
Parameters:
- configuration: Configuration: running configuration information
Returns:
- TestReport: running result of the test suite
static func builder(String)
public static func builder(name: String): TestSuiteBuilder
Description: Creates a test suite builder.
Parameters:
- name: String: test suite name
Returns:
- TestSuiteBuilder: test suite builder
static func builder(TestSuite)
public static func builder(suite: TestSuite): TestSuiteBuilder
Description: Creates a test suite builder.
Parameters:
- suite: TestSuite: test suite
Returns:
- TestSuiteBuilder: test suite builder
class TestSuiteBuilder
public class TestSuiteBuilder {}
Description: Provides methods for configuring test suites.
func add(Benchmark)
public func add(benchmark: Benchmark): TestSuiteBuilder
Description: Adds performance cases to a test suite.
Parameters:
- benchmark: Benchmark: performance test case
Returns:
- TestGroupBuilder: test group builder
func add(UnitTestCase)
public func add(test: UnitTestCase): TestSuiteBuilder
Description: Adds unit test cases to a test suite.
Parameters:
- test: UnitTestCase: unit test case
Returns:
- TestGroupBuilder: test group builder
func afterAll(() -> Unit)
public func afterAll(body: () -> Unit): TestSuiteBuilder
Description: Adds to a test suite a lifecycle management closure to be executed after all test cases have been completed.
Parameters:
- body: () -> Unit: executor
Returns:
- TestGroupBuilder: test group builder
func afterEach(() -> Unit)
public func afterEach(body: () -> Unit): TestSuiteBuilder
Description: Adds to a test suite a lifecycle management closure to be executed after each test case has been completed.
Parameters:
- body: () -> Unit: executor
Returns:
- TestGroupBuilder: test group builder
func afterEach((String) -> Unit)
public func afterEach(body: (String) -> Unit): TestSuiteBuilder
Description: Adds to a test suite a lifecycle management closure to be executed after each test case has been completed.
Parameters:
- body: (String) -> Unit: executor
Returns:
- TestGroupBuilder: test group builder
func beforeAll(() -> Unit)
public func beforeAll(body: () -> Unit): TestSuiteBuilder
Description: Adds to a test suite a lifecycle management closure to be executed before the execution of all test cases.
Parameters:
- body: () -> Unit: executor
Returns:
- TestGroupBuilder: test group builder
func beforeEach(() -> Unit)
public func beforeEach(body: () -> Unit): TestSuiteBuilder
Description: Adds to a test suite a lifecycle management closure to be executed before the execution of each test case.
Parameters:
- body: () -> Unit: executor
Returns:
- TestGroupBuilder: test group builder
func beforeEach((String) -> Unit)
public func beforeEach(body: (String) -> Unit): TestSuiteBuilder
Description: Adds to a test suite a lifecycle management closure to be executed before the execution of each test case.
Parameters:
- body: (String) -> Unit: executor
Returns:
- TestGroupBuilder: test group builder
func template(TestSuite)
public func template(template: TestSuite): TestSuiteBuilder
Description: Executes this method to set the test suite to a template.
Parameters:
- template: TestSuite: test suite to be used as a template
Returns:
- TestGroupBuilder: test group constructor
func build()
public func build(): TestSuite
Description: Constructs a test suite after the configuration is complete.
Returns:
- TestSuite: test suite
func configure(Configuration)
public func configure(configuration: Configuration): TestSuiteBuilder
Description: Adds configuration information to a test suite.
Parameters:
- configuration: Configuration: test configuration information
Returns:
- TestGroupBuilder: test group builder
func setName(String)
public func setName(name: String): TestSuiteBuilder
Description: Sets a name for the test suite.
Parameters:
- name: String: test suite name
Returns:
- TestGroupBuilder: test group builder
class UnitTestCase
public class UnitTestCase {}
Description: Provides methods for creating and executing unit test cases.
prop name
public prop name: String
Description: Obtains the name of a unit test.
Type: String
func run()
public func run(): TestReport
Description: Runs unit test cases.
Returns:
- TestReport: unit test execution result report
static func create(String, Configuration, () -> Unit)
public static func create(name: String, configuration!: Configuration = Configuration(), body!: () -> Unit): UnitTestCase
Description: Creates a unit test case.
Parameters:
- name: String: test case name
- configuration!: Configuration: test case configuration information
- body!: () -> Unit: test case executor
Returns:
- UnitTestCase: unit test case object
static func createParameterized<T>(String, DataStrategy<T>, Configuration, (T) -> Unit)
public static func createParameterized<T>(name: String, strategy: DataStrategy<T>, configuration!: Configuration = Configuration(), body!: (T) -> Unit): UnitTestCase
Description: Creates a parameterized unit test case.
Parameters:
- name: String: test case name
- strategy: DataStrategy: parameter data strategy
- configuration!: Configuration: test case configuration information
- body!: () -> Unit: test case executor
Returns:
- UnitTestCase: unit test case object
static func createParameterized<T>(String, DataStrategyProcessor<T>, Configuration, (T) -> Unit)
public static func createParameterized<T>(name: String, strategy: DataStrategyProcessor<T>, configuration!: Configuration = Configuration(), body!: (T) -> Unit): UnitTestCase
Description: Creates a parameterized unit test case.
Parameters:
- name: String: test case name
- strategy: DataStrategyProcessor: parameter data processor
- configuration!: Configuration: test case configuration information
- body!: () -> Unit: test case executor
Returns:
- UnitTestCase: unit test case object
class XmlReporter
public class XmlReporter <: Reporter<TestReport, Unit> {
public XmlReporter(let directory: Path)
}
Description: Prints unit test case results to an XML file.
Parent types:
init(Path)
public XmlReporter(let directory: Path)
Description: Specifies a constructor.
Parameters:
- directory: Path: directory where the printed file is generated