Releases: DevKitOrganization/DevTesting
Releases · DevKitOrganization/DevTesting
1.5.0
1.4.0
Stub and ThrowingStub now conform to Observable. The only property that is tracked is calls. Changes to dependent properties like callArguments and callResults can also be tracked, but changes to resultQueue and defaultResult are not.
1.3.0
Adds functions for randomly generating dates within a specified range.
Datehas been extended with two static functions, both spelledrandom(in:using:), that generate a random date in either a closed or half-open range.RandomValueGeneratinghas been extended with a new property requirement and two new functions.- The new property is a
ClosedRange<Date>spelleddefaultClosedDateRange. This property provides a default closed date range to use when generating random dates. A default implementation is provided. - The two new functions, both spelled
randomDate(in:), generate a random date in either a closed or half-open range using the aforementionedDateextension. The closed range version’s range parameter is optional. Whennilis used (the default),defaultClosedDateRangeis used.
- The new property is a
1.2.0
This version updates DevTesting to require version 26 of Apple’s OSes.
1.1.0
Adds two initializers to ThrowingStub: init(defaultReturnValue:resultQueue:) and init(defaultError:resultQueue:). These initializers enable cleaner call sites, as in the following example:
// Before
mock.doSomethingSuccessfullyStub = ThrowingStub(defaultResult: .success(value))
mock.doSomethingUnsuccessfullyStub = ThrowingStub(defaultResult: .failure(error))
// After
mock.doSomethingSuccessfullyStub = ThrowingStub(defaultReturnValue: value)
mock.doSomethingUnsuccessfullyStub = ThrowingStub(defaultError: error)1.0.0
This is the first release of DevTesting. The initial feature set includes
SeedableRandomNumberGenerator, a random number generator that can be seeded to enable repeatable tests with random data.RandomValueGenerating, a protocol that your test suite can conform to add random value generation. It uses a seedable random number generator, and logs the seed before every test so that you can debug tests that failed. It also includes convenient functions for generating random data:- Booleans
- Case iterables
- Data
- Floating point types
- Integer types
- Optionals
- Strings
- UUIDs
- URLs, URL components, and URL query items
StubandThrowingStubprovide stubbing and spying functionality for your mock objects.