From f184db3af55b50dd1b108efe290feec0461e8dc2 Mon Sep 17 00:00:00 2001 From: Aleh Dzenisiuk Date: Mon, 31 Oct 2022 10:19:02 +0100 Subject: [PATCH] Add allCasesDictionary for MMMLoadableState This pairs with certain unit tests using varyParameters to go through all loadable states. --- MMMTestCase.podspec | 2 +- Sources/MMMTestCase/MMMLoadableState.swift | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Sources/MMMTestCase/MMMLoadableState.swift diff --git a/MMMTestCase.podspec b/MMMTestCase.podspec index 0acf8cb..ee55d9d 100644 --- a/MMMTestCase.podspec +++ b/MMMTestCase.podspec @@ -6,7 +6,7 @@ Pod::Spec.new do |s| s.name = "MMMTestCase" - s.version = "1.7.0" + s.version = "1.8.0" s.summary = "Our helpers for FBTestCase and XCTestCase" s.description = s.summary s.homepage = "https://github.com/mediamonks/#{s.name}" diff --git a/Sources/MMMTestCase/MMMLoadableState.swift b/Sources/MMMTestCase/MMMLoadableState.swift new file mode 100644 index 0000000..13b5c09 --- /dev/null +++ b/Sources/MMMTestCase/MMMLoadableState.swift @@ -0,0 +1,17 @@ +// +// Starbucks App. +// Copyright (c) 2022 MediaMonks. All rights reserved. +// + +import MMMLoadable + +extension MMMLoadableState { + /// A dictionary with all states suitable for `MMMTestCase.varyParameters(_:block:)` + /// (keys are kebab-case already). + public private(set) static var allCasesDictionary: [String: MMMLoadableState] = [ + "idle": .idle, + "syncing": .syncing, + "did-fail-to-sync": .didFailToSync, + "did-sync-successfully": .didSyncSuccessfully + ] +}