-
Notifications
You must be signed in to change notification settings - Fork 2
Unit and Integration Testing
Unit Testing means testing a class in isolation from it's dependencies using test-doubles such as mocks or stubs.
For unit tests: Pilgrim is not required, just provide a test double (mock or stub) in place of the concrete dependency, although you might use an application component to help test assertions, as shown next.
Integration Testing means testing a class using real dependencies.
For integration tests, you can obtain a fully assembled component using the @Assembled
property wrapper like so. You can also obtain a helper class (such as the application configured JSON decoder):
class RealtimePayloadMarshallerTests: XCTestCase {
@Assembled var marshaller: RealtimePayloadMarshaller
@Assembled var decoder: JSONDecoder
func test_it_encodes_message() throws {
}
}
Something still not clear? How about posting a question on StackOverflow.
Get started in two minutes.
Get familiar with Pilgrim.
Become a Pilgrim expert.
For contributors or curious folks.