• Frontpage
  • Career
  • Music
  • Blog

Tests

These pages use the taxonomy term "Tests".

How I Test Functions Which Dispatch Tasks

November 11, 2022 • 1 minute read

Some functions dispatch tasks or code blocks to a different dispatch queue. I have wrapped the wait for that asynchronous code in an extension to XCTestCase.

How I Test View Controllers

November 11, 2022 • 4 minute read

By example I want to show how I instantiate and test view controllers from a storyboard in a macOS app using the conventional MVC pattern and AppKit.

How to write a Swift Mock Code Generator in Swift

November 7, 2022 • 5 minute read

Incontent with the Swift mocking solutions available I thought about how to write a mock code generator for Swift by myself. Getting started is surprisingly easy with Swift packages like Swift Argument Parser and SwiftSyntax.

© 2023 Peter Thomas Horn. Made with Hugo and Foundation for Sites. Legal Notice.