When using CocoaPods add following line to your Podfile:
pod 'FTTestingKit', '~> 0.5'
When using PromiseKit you can use either FTTestingKitPromiseKit
target for testing promises or add subspec to your Podfile:
pod 'FTTestingKit', '~> 0.5', subspecs: ['PromiseKit']
Features
Main features of this library are generating mockups,
random values, arrays and asynchronous testing.
Mockups
For simple repeated execution the library offers Ruby-like extension on Int type. This is helpful in measurement tests.
10.times {
doSomething()
}
10.times(doSomething)
This extension can create arrays too:
10.times {
Int.random()
}
10.times(String.random)
The framework extends some basic types (Date, String)
with random generation similar to Int.
All these types conform to Mockup protocol
which formally describes this functionality.
FTTestingKit
A set of helpers for simple creation of mockups, random values and testing of asynchronous code.
Installation
When using Swift package manager add this line to your dependencies or install using Xcode 11 or newer:
When using CocoaPods add following line to your
Podfile
:When using
PromiseKit
you can use eitherFTTestingKitPromiseKit
target for testing promises or add subspec to yourPodfile
:Features
Main features of this library are generating mockups, random values, arrays and asynchronous testing.
Mockups
For simple repeated execution the library offers Ruby-like extension on
Int
type. This is helpful in measurement tests.This extension can create arrays too:
The framework extends some basic types (
Date
,String
) with random generation similar toInt
. All these types conform toMockup
protocol which formally describes this functionality.Expectations
The framework extends
XCTestCase
with simple methods to call transactional asynchronous test like this:Extension for
PromiseKit
builds on this and offers testing promises using so-called belief in promise method:Author
Matěj Kašpar Jirásek, matej.jirasek@futured.app
License
FTTestingKit is available under the MIT license. See the LICENSE file for more info.