Swift Package with examples of how to tests iOS apps

Overview

GimmeTheCodeTDD

A swift package with examples of unit tests in iOS development.

Requirements

Xcode 13

Content

Dependency Injection

  • Constructor Injection
  • Setter Injection
  • Interface Injection]

Expectations

  • XCTestExpectation
  • XCTKVOExpectationExpectedValue
  • XCTKVOExpectationHandler
  • XCTNSNotificationExpectation
  • XCTNSPredicateExpectation
  • Waiting for Expectations

Easy Tests

  • Properties
  • Delegation

Target-Action

  • Sending All Actions

View Controller

  • View Loading
  • View Appearing
  • View Disappearing

View

  • Existence of Subviews
  • Update of Subviews

Table View Controller

  • Populating Cell
  • Populating Header
  • Insert Rows
  • Delete Rows
  • Move Row
  • Batch Updates

Table View Data Source

  • Number Of Rows
  • Header Title
  • Delete Row
  • Insert Row
  • ReorderRows

Table View Delegate

  • Will Display For Row
  • Indentation Level For Row
  • WillSelect Row
  • Select Cell
  • Height For Row

Collection View

  • Populating Cell
  • Populating Supplementary View
  • Insert Row
  • Delete Items

Collection View Data Source

  • Number Of Items
  • Setup Cell
  • Setup Supplementary View

Collection View Delegate

  • Should Select Item
  • Select Cell

Collection View Flow Layout

  • UICollectionViewFlowLayoutMinimumLineSpacing

Navigation Controller

  • Push
  • Pop

Presentation

  • PresentViewController

Coordinator Pattern

  • Start
  • PushNext

Notifications

  • Sending
  • Sending With User Info
  • Receiving

Networking

  • Stubbing With URLProtocol
  • Stubbing With URLSession
  • Stubbing With UploadTask
  • Stubbing async/await

Alerts

  • Simple
  • Swizzling Complete
  • Action With Factory

Core Location

  • Location Services Enabled
  • NSLocationWhenInUseUsageDescription
  • Request When In Use
  • Setting Delegate
  • Setting Distance Filter
  • Setting Desired Accuracy
  • Start Updating Location
  • Stop Updating Location
  • Request Location

Date

  • DateFilterFutureEvents

Storyboards

  • Overview
  • Storyboard Identifier
  • Outlet
  • Segue

Author

Dominik Hauser, @dasdom

Licence

MIT

You might also like...
Trying to implement Unit Tests for @Binding properties in a ViewModel

BindingTester Trying to implement Unit Tests for @Binding properties in a ViewModel ViewModel to be tested class SheetViewModel: ObservableObject {

Catching fatal errors in unit tests

Precondition Catching When running tests which hit fatal errors, often preconditions the built-in support with XCTest. One package which supports cach

Small library to easily run your tests directly within a Playground
Small library to easily run your tests directly within a Playground

[] (https://developer.apple.com/swift/) Build Status Branch Status master develop About PlaygroundTDD enables you to use TDD directly on Xcode Playgro

Write unit tests which test the layout of a view in multiple configurations
Write unit tests which test the layout of a view in multiple configurations

Overview This library enables you to write unit tests which test the layout of a view in multiple configurations. It tests the view with different dat

UITest helper library for creating readable and maintainable tests

UITestHelper General information When creating UI tests you will see that you are often repeating the same pieces of code. The UITestHelper library wi

Tool for generating Acceptance Tests in Xcode, inspired by Fitnesse
Tool for generating Acceptance Tests in Xcode, inspired by Fitnesse

AcceptanceMark is a tool for generating Acceptance Tests in Xcode, inspired by Fitnesse. Read this blog post for a full introduction to AcceptanceMark

Marvel - Marvel Characters App using MVVM, and including unit tests
Marvel - Marvel Characters App using MVVM, and including unit tests

Marvel About The purpose of this project is to develop a app using MVVM, and inc

Detailed explanations and implementations of various maths concepts for writing high performance code/algorithms backed with Unit tests.

Detailed explanations and implementations of various maths concepts which can help software Engineers write high performance code/algorithms backed with Unit tests.

PlaygroundTester enables you to easily run tests for your iPad Playgrounds 4 project.

PlaygroundTester PlaygroundTester is a package that enables you to add tests to your iPad Swift Playgrounds project. Installation Just add PlaygroundT

Owner
Dominik Hauser
iOS, Swift, ObjC, Author
Dominik Hauser
Bluepill is a reliable iOS testing tool that runs UI tests using multiple simulators on a single machine

Bluepill is a tool to run iOS tests in parallel using multiple simulators. Motivation LinkedIn created Bluepill to run its large iOS test suite in a r

Mobile Native Foundation 3.1k Jan 3, 2023
Upload failing iOS snapshot tests cases to S3

Second Curtain If you're using the cool FBSnapshotTestCase to test your iOS view logic, awesome! Even better if you have continuous integration, like

Ash Furrow 129 Sep 6, 2022
A collection of useful test helpers designed to ease the burden of writing tests for iOS applications.

MetovaTestKit is a collection of useful test helpers designed to ease the burden of writing tests for iOS applications. Requirements Installation Usag

null 23 Aug 29, 2021
Snapshot view unit tests for iOS

iOSSnapshotTestCase (previously FBSnapshotTestCase) What it does A "snapshot test case" takes a configured UIView or CALayer and uses the necessary UI

Uber Open Source 1.7k Jan 4, 2023
TestSchedulerDemo - Demonstration code for iOS Unit Tests and Asynchronous

TestSchedulerDemo This repository contains demonstration code for my Medium arti

Carsten Wenderdel 0 Mar 19, 2022
Mockit is a Tasty mocking framework for unit tests in Swift 5.0

Mockit Introduction Mockit is a Tasty mocking framework for unit tests in Swift 5.0. It's at an early stage of development, but its current features a

Syed Sabir Salman-Al-Musawi 118 Oct 17, 2022
Swift framework containing a set of helpful XCTest extensions for writing UI automation tests

AutoMate • AppBuddy • Templates • ModelGenie AutoMate AutoMate is a Swift framework containing a set of helpful XCTest extensions for writing UI autom

PGS Software 274 Dec 30, 2022
Freezer is a library that allows your Swift tests to travel through time by mocking NSDate class.

Freezer Freezer is a library that allows your Swift tests to travel through time by mocking NSDate class. Usage Once Freezer.start() has been invoked,

Sergey Petrov 8 Sep 24, 2022
UI Testing Cheat Sheet and Examples.

UI Testing Cheat Sheet This repository is complementary code for my post, UI Testing Cheat Sheet and Examples. The post goes into more detail with exa

Joe Masilotti 2.1k Dec 25, 2022
Erik is an headless browser based on WebKit. An headless browser allow to run functional tests, to access and manipulate webpages using javascript.

Erik Erik is a headless browser based on WebKit and HTML parser Kanna. An headless browser allow to run functional tests, to access and manipulate web

Eric Marchand 544 Dec 30, 2022