From 69a322ec71fc23ca2edb3e0356d8fb5d03e58493 Mon Sep 17 00:00:00 2001 From: Logan Gauthier Date: Wed, 12 Jul 2017 13:32:32 -0500 Subject: [PATCH 1/6] Add assertion for presenting UIAlertControllers. --- CHANGELOG.md | 1 + HostApplicationForTesting/AppDelegate.swift | 20 ++ .../AppIcon.appiconset/Contents.json | 68 +++++ .../Base.lproj/LaunchScreen.storyboard | 27 ++ .../Base.lproj/Main.storyboard | 26 ++ HostApplicationForTesting/Info.plist | 45 +++ .../ViewController.swift | 11 + HostedTests/Info.plist | 22 ++ .../UIAlertControllerTestingTests.swift | 278 +++++++++++++++++ MetovaTestKit.xcodeproj/project.pbxproj | 280 +++++++++++++++++- .../xcschemes/MetovaTestKit.xcscheme | 38 +++ MetovaTestKit/Internal/Array+Utilities.swift | 19 +- MetovaTestKit/QuotedString.swift | 22 ++ .../UIAlertControllerAssertions.swift | 125 ++++++++ .../UIViewController+TestUtilities.swift | 18 ++ MetovaTestKitTests/MTKBaseTestCase.swift | 31 +- MetovaTestKitTests/QuotedStringTests.swift | 20 ++ .../UISegmentedControlTestingTests.swift | 8 +- README.md | 17 ++ 19 files changed, 1057 insertions(+), 19 deletions(-) create mode 100644 HostApplicationForTesting/AppDelegate.swift create mode 100644 HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard create mode 100644 HostApplicationForTesting/Base.lproj/Main.storyboard create mode 100644 HostApplicationForTesting/Info.plist create mode 100644 HostApplicationForTesting/ViewController.swift create mode 100644 HostedTests/Info.plist create mode 100644 HostedTests/UIAlertControllerTestingTests.swift create mode 100644 MetovaTestKit/QuotedString.swift create mode 100644 MetovaTestKit/UIAlertControllerAssertions.swift create mode 100644 MetovaTestKit/UIViewController+TestUtilities.swift create mode 100644 MetovaTestKitTests/QuotedStringTests.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index cb64427..a41ca14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Added assertion for UIControl target/action. - Added assertion for UISegmentedControl segment titles. - Added async testing utility. +- Added assertion for displaying UIAlertControllers. ## 1.0.0 diff --git a/HostApplicationForTesting/AppDelegate.swift b/HostApplicationForTesting/AppDelegate.swift new file mode 100644 index 0000000..dede6f2 --- /dev/null +++ b/HostApplicationForTesting/AppDelegate.swift @@ -0,0 +1,20 @@ +// +// AppDelegate.swift +// HostApplicationForTesting +// +// Created by Logan Gauthier on 6/28/17. +// Copyright © 2017 Metova. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + + return true + } +} diff --git a/HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json b/HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..36d2c80 --- /dev/null +++ b/HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard b/HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..fdf3f97 --- /dev/null +++ b/HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HostApplicationForTesting/Base.lproj/Main.storyboard b/HostApplicationForTesting/Base.lproj/Main.storyboard new file mode 100644 index 0000000..273375f --- /dev/null +++ b/HostApplicationForTesting/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HostApplicationForTesting/Info.plist b/HostApplicationForTesting/Info.plist new file mode 100644 index 0000000..d052473 --- /dev/null +++ b/HostApplicationForTesting/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/HostApplicationForTesting/ViewController.swift b/HostApplicationForTesting/ViewController.swift new file mode 100644 index 0000000..f12d534 --- /dev/null +++ b/HostApplicationForTesting/ViewController.swift @@ -0,0 +1,11 @@ +// +// ViewController.swift +// HostApplicationForTesting +// +// Created by Logan Gauthier on 6/28/17. +// Copyright © 2017 Metova. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { } diff --git a/HostedTests/Info.plist b/HostedTests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/HostedTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/HostedTests/UIAlertControllerTestingTests.swift b/HostedTests/UIAlertControllerTestingTests.swift new file mode 100644 index 0000000..ed99a96 --- /dev/null +++ b/HostedTests/UIAlertControllerTestingTests.swift @@ -0,0 +1,278 @@ +// +// UIAlertControllerTestingTests.swift +// HostedTests +// +// Created by Logan Gauthier on 6/28/17. +// Copyright © 2017 Metova. All rights reserved. +// + +import XCTest +import MetovaTestKit + +@testable import HostApplicationForTesting + +class UIAlertControllerTestingTests: MTKBaseTestCase { + + // MARK: Properties + + var testVC: UIViewController! + + // MARK: Setup/Teardown + + override func setUp() { + + super.setUp() + + testVC = UIViewController() + testVC.addToWindow() + } + + // MARK: Test Presentation + + func testFailureDueToNoAlertBeingPresented() { + + let failureExpectation = TestFailureExpectation(description: "failed - No alert was presented.", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: []) + } + } + + // MARK: Test Style + + func testFailureDueToIncorrectStyle() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have style `.actionSheet`. Instead found `.alert`.", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .actionSheet, title: "Title", message: "Message", actions: []) + } + } + + // MARK: Test Title + + func testFailureDueToAlertHavingIncorrectTitle() { + + let alert = UIAlertController(title: "Incorrect Title", message: "Message", preferredStyle: .alert) + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have title \"Title\". Instead found \"Incorrect Title\".", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: []) + } + } + + func testFailureDueToAlertHavingNilTitle() { + + let alert = UIAlertController(title: nil, message: "Message", preferredStyle: .alert) + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have title \"Title\". Instead found nil.", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: []) + } + } + + func testFailureDueToAlertHavingNonNilTitle() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have title nil. Instead found \"Title\".", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: nil, message: "Message", actions: []) + } + } + + // MARK: Test Message + + func testFailureDueToAlertHavingIncorrectMessage() { + + let alert = UIAlertController(title: "Title", message: "Incorrect Message", preferredStyle: .alert) + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have message \"Message\". Instead found \"Incorrect Message\".", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: []) + } + } + + func testFailureDueToAlertHavingNilMessage() { + + let alert = UIAlertController(title: "Title", message: nil, preferredStyle: .alert) + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have message \"Message\". Instead found nil.", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: []) + } + } + + func testFailureDueToAlertHavingNonNilMessage() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have message nil. Instead found \"Message\".", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: nil, actions: []) + } + } + + // MARK: Test Actions + + func testFailureDueToAlertHavingNoAction() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have actions: [(title: \"Action Title\", style: .default)]. Instead found [].", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: [ExpectedAlertAction(title: "Action Title", style: .default)]) + } + } + + func testFailureDueToAlertHavingIncorrectActionTitle() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + let action = UIAlertAction(title: "Incorrect Action Title", style: .default, handler: nil) + alert.addAction(action) + + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have actions: [(title: \"Action Title\", style: .default)]. Instead found [(title: \"Incorrect Action Title\", style: .default)].", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: [ExpectedAlertAction(title: "Action Title", style: .default)]) + } + } + + func testFailureDueToAlertMissingAnAction() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + let action = UIAlertAction(title: "Action Title1", style: .default, handler: nil) + alert.addAction(action) + + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have actions: [(title: \"Action Title1\", style: .default), (title: \"Action Title2\", style: .default)]. Instead found [(title: \"Action Title1\", style: .default)].", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: [ExpectedAlertAction(title: "Action Title1", style: .default), ExpectedAlertAction(title: "Action Title2", style: .default)]) + } + } + + func testFailureDueToAlertHavingAnExtraAction() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + let action1 = UIAlertAction(title: "Action Title1", style: .default, handler: nil) + let action2 = UIAlertAction(title: "Action Title2", style: .default, handler: nil) + alert.addAction(action1) + alert.addAction(action2) + + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have actions: [(title: \"Action Title1\", style: .default)]. Instead found [(title: \"Action Title1\", style: .default), (title: \"Action Title2\", style: .default)].", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: [ExpectedAlertAction(title: "Action Title1", style: .default)]) + } + } + + func testFailureDueToAlertHavingActionsInTheIncorrectOrder() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + let action1 = UIAlertAction(title: "Action Title1", style: .default, handler: nil) + let action2 = UIAlertAction(title: "Action Title2", style: .default, handler: nil) + alert.addAction(action2) + alert.addAction(action1) + + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have actions: [(title: \"Action Title1\", style: .default), (title: \"Action Title2\", style: .default)]. Instead found [(title: \"Action Title2\", style: .default), (title: \"Action Title1\", style: .default)].", filePath: #file) + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: [ExpectedAlertAction(title: "Action Title1", style: .default), ExpectedAlertAction(title: "Action Title2", style: .default)]) + } + } + + func testFailureDueToAlertHavingCorrectActionTitlesAndIncorrectStyles() { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: .alert) + let action1 = UIAlertAction(title: "Action Title1", style: .default, handler: nil) + let action2 = UIAlertAction(title: "Action Title2", style: .cancel, handler: nil) + alert.addAction(action1) + alert.addAction(action2) + + testVC.present(alert, animated: false, completion: nil) + + let failureExpectation = TestFailureExpectation(description: "failed - Expected alert to have actions: [(title: \"Action Title1\", style: .default), (title: \"Action Title2\", style: .destructive)]. Instead found [(title: \"Action Title1\", style: .default), (title: \"Action Title2\", style: .cancel)].", filePath: #file) + + let expectedActions = [ + ExpectedAlertAction(title: "Action Title1", style: .default), + ExpectedAlertAction(title: "Action Title2", style: .destructive) + ] + + expectTestFailure(failureExpectation) { + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: expectedActions) + } + } + + // MARK: Test Success Case + + func testSuccessCaseForAlertStyle() { + + let alert = createSuccessCaseAlert(withStyle: .alert) + + testVC.present(alert, animated: false, completion: nil) + + let expectedActions = [ + ExpectedAlertAction(title: "Default", style: .default), + ExpectedAlertAction(title: "Cancel", style: .cancel), + ExpectedAlertAction(title: "Destructive", style: .destructive) + ] + + MTKAssertAlertIsPresented(by: testVC, style: .alert, title: "Title", message: "Message", actions: expectedActions) + } + + func testSuccessCaseForActionSheetStyle() { + + let alert = createSuccessCaseAlert(withStyle: .actionSheet) + + testVC.present(alert, animated: false, completion: nil) + + let expectedActions = [ + ExpectedAlertAction(title: "Default", style: .default), + ExpectedAlertAction(title: "Cancel", style: .cancel), + ExpectedAlertAction(title: "Destructive", style: .destructive) + ] + + MTKAssertAlertIsPresented(by: testVC, style: .actionSheet, title: "Title", message: "Message", actions: expectedActions) + } + + func createSuccessCaseAlert(withStyle style: UIAlertControllerStyle) -> UIAlertController { + + let alert = UIAlertController(title: "Title", message: "Message", preferredStyle: style) + + let defaultAction = UIAlertAction(title: "Default", style: .default, handler: nil) + let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) + let destructiveAction = UIAlertAction(title: "Destructive", style: .destructive, handler: nil) + + alert.addAction(defaultAction) + alert.addAction(cancelAction) + alert.addAction(destructiveAction) + + return alert + } +} diff --git a/MetovaTestKit.xcodeproj/project.pbxproj b/MetovaTestKit.xcodeproj/project.pbxproj index 577cc6f..ab14041 100644 --- a/MetovaTestKit.xcodeproj/project.pbxproj +++ b/MetovaTestKit.xcodeproj/project.pbxproj @@ -24,14 +24,26 @@ 4A8AD4F11CDEB6C30085984D /* TestableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8AD4EF1CDEB6C30085984D /* TestableViewController.swift */; }; 4A8AD4F21CDEB6C30085984D /* TestableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4A8AD4F01CDEB6C30085984D /* TestableViewController.xib */; }; 4A8AD4F41CDEB7A60085984D /* TestableProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8AD4F31CDEB7A60085984D /* TestableProtocolTests.swift */; }; + 6E23680A1F035295008E3231 /* UIViewController+TestUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */; }; + 6E2368161F043F37008E3231 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368151F043F37008E3231 /* AppDelegate.swift */; }; + 6E2368181F043F37008E3231 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368171F043F37008E3231 /* ViewController.swift */; }; + 6E23681B1F043F37008E3231 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E2368191F043F37008E3231 /* Main.storyboard */; }; + 6E23681D1F043F37008E3231 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6E23681C1F043F37008E3231 /* Assets.xcassets */; }; + 6E2368201F043F37008E3231 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E23681E1F043F37008E3231 /* LaunchScreen.storyboard */; }; + 6E23682C1F043F5A008E3231 /* UIAlertControllerTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */; }; + 6E2368331F0440EF008E3231 /* MTKBaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A771FC81D4D534200EFD0B8 /* MTKBaseTestCase.swift */; }; + 6E2368341F045FFD008E3231 /* MetovaTestKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A3CFEF71CDD5F37003EF6F0 /* MetovaTestKit.framework */; }; + 6E2368361F046B26008E3231 /* QuotedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368351F046B26008E3231 /* QuotedString.swift */; }; 6E8D4B081EB7C5DF001284FD /* FailureRecording.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B071EB7C5DF001284FD /* FailureRecording.swift */; }; 6E8D4B0C1EB7CF68001284FD /* UIControlTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B0B1EB7CF67001284FD /* UIControlTestingTests.swift */; }; 6E8D4B191EB8138B001284FD /* UIControlAssertions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B181EB8138B001284FD /* UIControlAssertions.swift */; }; 6E8D4B1E1EB8D660001284FD /* FailureRecordingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B1D1EB8D660001284FD /* FailureRecordingTests.swift */; }; 6E8D4B221EB941B9001284FD /* UISegmentedControlAssertions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B211EB941B9001284FD /* UISegmentedControlAssertions.swift */; }; 6E8D4B241EB941F8001284FD /* Array+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B231EB941F8001284FD /* Array+Utilities.swift */; }; + 6E98F0BB1F15931D009C15FB /* QuotedStringTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E98F0BA1F15931D009C15FB /* QuotedStringTests.swift */; }; 6EC1A6B01EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EC1A6AF1EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift */; }; 6EC1A6B31EBCE2E2000DEFA6 /* AsyncTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EC1A6B21EBCE2E2000DEFA6 /* AsyncTestingTests.swift */; }; + 6ED689011EFC2D3C0040C243 /* UIAlertControllerAssertions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6ED689001EFC2D3C0040C243 /* UIAlertControllerAssertions.swift */; }; 6EF9B23B1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EF9B23A1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift */; }; /* End PBXBuildFile section */ @@ -43,6 +55,13 @@ remoteGlobalIDString = 4A3CFEF61CDD5F37003EF6F0; remoteInfo = MetovaTestKit; }; + 6E23682E1F043F5A008E3231 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4A3CFEEE1CDD5F37003EF6F0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6E2368121F043F37008E3231; + remoteInfo = HostApplicationForTesting; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -77,6 +96,18 @@ 4A8AD4F51CDEDF110085984D /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; }; 4A8AD4F71CDEE4220085984D /* .travis.yml */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; path = .travis.yml; sourceTree = ""; }; 4AB9A3E01CDF6AB00021B6B8 /* Gemfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; indentWidth = 2; path = Gemfile; sourceTree = ""; }; + 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+TestUtilities.swift"; sourceTree = ""; }; + 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HostApplicationForTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6E2368151F043F37008E3231 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6E2368171F043F37008E3231 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6E23681A1F043F37008E3231 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6E23681C1F043F37008E3231 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6E23681F1F043F37008E3231 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6E2368211F043F37008E3231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6E2368291F043F5A008E3231 /* HostedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HostedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIAlertControllerTestingTests.swift; sourceTree = ""; }; + 6E23682D1F043F5A008E3231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6E2368351F046B26008E3231 /* QuotedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuotedString.swift; sourceTree = ""; }; 6E8D4B071EB7C5DF001284FD /* FailureRecording.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FailureRecording.swift; path = Internal/FailureRecording.swift; sourceTree = ""; }; 6E8D4B0B1EB7CF67001284FD /* UIControlTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIControlTestingTests.swift; sourceTree = ""; }; 6E8D4B181EB8138B001284FD /* UIControlAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIControlAssertions.swift; path = UIKitTesting/UIControlAssertions.swift; sourceTree = ""; }; @@ -84,8 +115,10 @@ 6E8D4B1D1EB8D660001284FD /* FailureRecordingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FailureRecordingTests.swift; sourceTree = ""; }; 6E8D4B211EB941B9001284FD /* UISegmentedControlAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISegmentedControlAssertions.swift; path = UIKitTesting/UISegmentedControlAssertions.swift; sourceTree = ""; }; 6E8D4B231EB941F8001284FD /* Array+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+Utilities.swift"; path = "Internal/Array+Utilities.swift"; sourceTree = ""; }; + 6E98F0BA1F15931D009C15FB /* QuotedStringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuotedStringTests.swift; sourceTree = ""; }; 6EC1A6AF1EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+AsyncTesting.swift"; sourceTree = ""; }; 6EC1A6B21EBCE2E2000DEFA6 /* AsyncTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsyncTestingTests.swift; sourceTree = ""; }; + 6ED689001EFC2D3C0040C243 /* UIAlertControllerAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIAlertControllerAssertions.swift; sourceTree = ""; }; 6EF9B23A1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UISegmentedControlTestingTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -106,6 +139,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6E2368101F043F37008E3231 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E2368261F043F59008E3231 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E2368341F045FFD008E3231 /* MetovaTestKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -115,6 +163,8 @@ 4A3CFF111CDD600C003EF6F0 /* Related Files */, 4A3CFEF91CDD5F37003EF6F0 /* MetovaTestKit */, 4A3CFF051CDD5F37003EF6F0 /* MetovaTestKitTests */, + 6E2368141F043F37008E3231 /* HostApplicationForTesting */, + 6E23682A1F043F5A008E3231 /* HostedTests */, 4A3CFEF81CDD5F37003EF6F0 /* Products */, 4A3CFFCC1CDE1480003EF6F0 /* Dependencies */, ); @@ -125,6 +175,8 @@ children = ( 4A3CFEF71CDD5F37003EF6F0 /* MetovaTestKit.framework */, 4A3CFF011CDD5F37003EF6F0 /* MetovaTestKitTests.xctest */, + 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */, + 6E2368291F043F5A008E3231 /* HostedTests.xctest */, ); name = Products; sourceTree = ""; @@ -132,6 +184,7 @@ 4A3CFEF91CDD5F37003EF6F0 /* MetovaTestKit */ = { isa = PBXGroup; children = ( + 6E2368081F03527C008E3231 /* Test Setup Utilities */, 6EC1A6AE1EBCDD3F000DEFA6 /* AsynchronousTesting */, 6E8D4B041EB7AD1B001284FD /* Internal Utilities */, 6E8D4AFF1EB7AB70001284FD /* UIKitTesting */, @@ -224,11 +277,42 @@ name = "Supporting Test Files"; sourceTree = ""; }; + 6E2368081F03527C008E3231 /* Test Setup Utilities */ = { + isa = PBXGroup; + children = ( + 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */, + ); + name = "Test Setup Utilities"; + sourceTree = ""; + }; + 6E2368141F043F37008E3231 /* HostApplicationForTesting */ = { + isa = PBXGroup; + children = ( + 6E2368151F043F37008E3231 /* AppDelegate.swift */, + 6E2368171F043F37008E3231 /* ViewController.swift */, + 6E2368191F043F37008E3231 /* Main.storyboard */, + 6E23681C1F043F37008E3231 /* Assets.xcassets */, + 6E23681E1F043F37008E3231 /* LaunchScreen.storyboard */, + 6E2368211F043F37008E3231 /* Info.plist */, + ); + path = HostApplicationForTesting; + sourceTree = ""; + }; + 6E23682A1F043F5A008E3231 /* HostedTests */ = { + isa = PBXGroup; + children = ( + 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */, + 6E23682D1F043F5A008E3231 /* Info.plist */, + ); + path = HostedTests; + sourceTree = ""; + }; 6E8D4AFF1EB7AB70001284FD /* UIKitTesting */ = { isa = PBXGroup; children = ( 6E8D4B181EB8138B001284FD /* UIControlAssertions.swift */, 6E8D4B211EB941B9001284FD /* UISegmentedControlAssertions.swift */, + 6ED689001EFC2D3C0040C243 /* UIAlertControllerAssertions.swift */, ); name = UIKitTesting; sourceTree = ""; @@ -238,6 +322,7 @@ children = ( 6E8D4B071EB7C5DF001284FD /* FailureRecording.swift */, 6E8D4B231EB941F8001284FD /* Array+Utilities.swift */, + 6E2368351F046B26008E3231 /* QuotedString.swift */, ); name = "Internal Utilities"; sourceTree = ""; @@ -264,6 +349,7 @@ isa = PBXGroup; children = ( 6E8D4B1D1EB8D660001284FD /* FailureRecordingTests.swift */, + 6E98F0BA1F15931D009C15FB /* QuotedStringTests.swift */, ); name = "Internal Utilities Tests"; sourceTree = ""; @@ -338,6 +424,41 @@ productReference = 4A3CFF011CDD5F37003EF6F0 /* MetovaTestKitTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; + 6E2368121F043F37008E3231 /* HostApplicationForTesting */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6E2368221F043F37008E3231 /* Build configuration list for PBXNativeTarget "HostApplicationForTesting" */; + buildPhases = ( + 6E23680F1F043F37008E3231 /* Sources */, + 6E2368101F043F37008E3231 /* Frameworks */, + 6E2368111F043F37008E3231 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HostApplicationForTesting; + productName = HostApplicationForTesting; + productReference = 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */; + productType = "com.apple.product-type.application"; + }; + 6E2368281F043F59008E3231 /* HostedTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6E2368301F043F5A008E3231 /* Build configuration list for PBXNativeTarget "HostedTests" */; + buildPhases = ( + 6E2368251F043F59008E3231 /* Sources */, + 6E2368261F043F59008E3231 /* Frameworks */, + 6E2368271F043F59008E3231 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6E23682F1F043F5A008E3231 /* PBXTargetDependency */, + ); + name = HostedTests; + productName = HostedTests; + productReference = 6E2368291F043F5A008E3231 /* HostedTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -345,7 +466,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = ""; - LastSwiftUpdateCheck = 0730; + LastSwiftUpdateCheck = 0830; LastUpgradeCheck = 0800; ORGANIZATIONNAME = Metova; TargetAttributes = { @@ -357,6 +478,15 @@ CreatedOnToolsVersion = 7.3; LastSwiftMigration = 0800; }; + 6E2368121F043F37008E3231 = { + CreatedOnToolsVersion = 8.3.3; + ProvisioningStyle = Automatic; + }; + 6E2368281F043F59008E3231 = { + CreatedOnToolsVersion = 8.3.3; + ProvisioningStyle = Automatic; + TestTargetID = 6E2368121F043F37008E3231; + }; }; }; buildConfigurationList = 4A3CFEF11CDD5F37003EF6F0 /* Build configuration list for PBXProject "MetovaTestKit" */; @@ -365,6 +495,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 4A3CFEED1CDD5F37003EF6F0; productRefGroup = 4A3CFEF81CDD5F37003EF6F0 /* Products */; @@ -373,6 +504,8 @@ targets = ( 4A3CFEF61CDD5F37003EF6F0 /* MetovaTestKit */, 4A3CFF001CDD5F37003EF6F0 /* MetovaTestKitTests */, + 6E2368121F043F37008E3231 /* HostApplicationForTesting */, + 6E2368281F043F59008E3231 /* HostedTests */, ); }; /* End PBXProject section */ @@ -393,6 +526,23 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6E2368111F043F37008E3231 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E2368201F043F37008E3231 /* LaunchScreen.storyboard in Resources */, + 6E23681D1F043F37008E3231 /* Assets.xcassets in Resources */, + 6E23681B1F043F37008E3231 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E2368271F043F59008E3231 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -432,12 +582,15 @@ buildActionMask = 2147483647; files = ( 6E8D4B241EB941F8001284FD /* Array+Utilities.swift in Sources */, + 6E2368361F046B26008E3231 /* QuotedString.swift in Sources */, 4A771F331D4C155700EFD0B8 /* MTKConstraintTester.swift in Sources */, 4A771F311D4C144400EFD0B8 /* MTKBrokenConstraintCounter.m in Sources */, + 6ED689011EFC2D3C0040C243 /* UIAlertControllerAssertions.swift in Sources */, 4A8AD4EB1CDEA2B60085984D /* MTKExceptionTesting.swift in Sources */, 4A8AD4ED1CDEA53A0085984D /* MTKTestable+UIViewController.swift in Sources */, 6E8D4B191EB8138B001284FD /* UIControlAssertions.swift in Sources */, 4A3CFF231CDD60CA003EF6F0 /* MTKExceptionTester.m in Sources */, + 6E23680A1F035295008E3231 /* UIViewController+TestUtilities.swift in Sources */, 6E8D4B221EB941B9001284FD /* UISegmentedControlAssertions.swift in Sources */, 6E8D4B081EB7C5DF001284FD /* FailureRecording.swift in Sources */, 6EC1A6B01EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift in Sources */, @@ -451,6 +604,7 @@ files = ( 4A8AD4F11CDEB6C30085984D /* TestableViewController.swift in Sources */, 4A771F351D4C173300EFD0B8 /* ConstraintTestingTests.swift in Sources */, + 6E98F0BB1F15931D009C15FB /* QuotedStringTests.swift in Sources */, 4A771FC91D4D534200EFD0B8 /* MTKBaseTestCase.swift in Sources */, 6EF9B23B1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift in Sources */, 4A8AD4F41CDEB7A60085984D /* TestableProtocolTests.swift in Sources */, @@ -461,6 +615,24 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6E23680F1F043F37008E3231 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E2368181F043F37008E3231 /* ViewController.swift in Sources */, + 6E2368161F043F37008E3231 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6E2368251F043F59008E3231 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6E23682C1F043F5A008E3231 /* UIAlertControllerTestingTests.swift in Sources */, + 6E2368331F0440EF008E3231 /* MTKBaseTestCase.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -469,8 +641,32 @@ target = 4A3CFEF61CDD5F37003EF6F0 /* MetovaTestKit */; targetProxy = 4A3CFF031CDD5F37003EF6F0 /* PBXContainerItemProxy */; }; + 6E23682F1F043F5A008E3231 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6E2368121F043F37008E3231 /* HostApplicationForTesting */; + targetProxy = 6E23682E1F043F5A008E3231 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + 6E2368191F043F37008E3231 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6E23681A1F043F37008E3231 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6E23681E1F043F37008E3231 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6E23681F1F043F37008E3231 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 4A3CFF091CDD5F37003EF6F0 /* Debug */ = { isa = XCBuildConfiguration; @@ -647,6 +843,70 @@ }; name = Release; }; + 6E2368231F043F37008E3231 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + INFOPLIST_FILE = HostApplicationForTesting/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostApplicationForTesting; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 6E2368241F043F37008E3231 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + INFOPLIST_FILE = HostApplicationForTesting/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostApplicationForTesting; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 6E2368311F043F5A008E3231 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + INFOPLIST_FILE = HostedTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostedTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HostApplicationForTesting.app/HostApplicationForTesting"; + }; + name = Debug; + }; + 6E2368321F043F5A008E3231 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + INFOPLIST_FILE = HostedTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostedTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HostApplicationForTesting.app/HostApplicationForTesting"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -677,6 +937,24 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 6E2368221F043F37008E3231 /* Build configuration list for PBXNativeTarget "HostApplicationForTesting" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6E2368231F043F37008E3231 /* Debug */, + 6E2368241F043F37008E3231 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6E2368301F043F5A008E3231 /* Build configuration list for PBXNativeTarget "HostedTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6E2368311F043F5A008E3231 /* Debug */, + 6E2368321F043F5A008E3231 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 4A3CFEEE1CDD5F37003EF6F0 /* Project object */; diff --git a/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme b/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme index 02518fc..0d601f4 100644 --- a/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme +++ b/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme @@ -34,6 +34,34 @@ ReferencedContainer = "container:MetovaTestKit.xcodeproj"> + + + + + + + + + + + + String { + + return "[" + map({ "\($0)" }).joined(separator: ", ") + "]" + } + + /// Convenience method for generating a comma separated list of items in qutoes. /// /// - Returns: A comma separated list of items where each item is surrounded by quotes. func commaSeparatedQuotedList() -> String { - var itemsInQuotes = map { "\"\($0)\"" } - - if itemsInQuotes.count > 1 { - let lastItem = itemsInQuotes.removeLast() - return itemsInQuotes.joined(separator: ", ") + ", and \(lastItem)" - } + let itemsInQuotes = map { "\"\($0)\"" } - return itemsInQuotes.joined(separator: ", ") + return itemsInQuotes.commaSeparatedList() } } diff --git a/MetovaTestKit/QuotedString.swift b/MetovaTestKit/QuotedString.swift new file mode 100644 index 0000000..97ba7e6 --- /dev/null +++ b/MetovaTestKit/QuotedString.swift @@ -0,0 +1,22 @@ +// +// QuotedString.swift +// MetovaTestKit +// +// Created by Logan Gauthier on 6/28/17. +// Copyright © 2017 Metova. All rights reserved. +// + +import Foundation + +/// Utility for producing descriptions for `String?` types without being wrapped in "Optional()". +/// +/// - Parameter string: An optional String. +/// - Returns: The unwrapped value, if it exists. Otherwise, it returns an empty String. +func quotedString(_ string: String?) -> String { + + guard let string = string else { + return "nil" + } + + return "\"\(string)\"" +} diff --git a/MetovaTestKit/UIAlertControllerAssertions.swift b/MetovaTestKit/UIAlertControllerAssertions.swift new file mode 100644 index 0000000..8db902f --- /dev/null +++ b/MetovaTestKit/UIAlertControllerAssertions.swift @@ -0,0 +1,125 @@ +// +// UIAlertControllerAssertions.swift +// MetovaTestKit +// +// Created by Logan Gauthier on 6/22/17. +// Copyright © 2017 Metova. All rights reserved. +// + +import Foundation + +// MARK: - Assertions + +/// Test that a view controller presented an alert with the specified title, message, action titles, and action styles. +/// +/// - Parameters: +/// - presenter: The view controller expected to have presented the alert. +/// - style: The expected style of the alert. +/// - title: The expected title of the alert. +/// - message: The expected message of the alert. +/// - actions: The list of expected actions in the expected order. +/// - failureMessage: The message to log upon failure. +/// - file: The name of the file to report the failure for. The default value will report the file from which this method is called. +/// - line: The line number to report the failure for. The default value will report the line number of the calling site. +public func MTKAssertAlertIsPresented(by presenter: UIViewController, style: UIAlertControllerStyle, title: String?, message: String?, actions: [ExpectedAlertAction], _ failureMessage: String? = nil, file: StaticString = #file, line: UInt = #line) { + + guard let alert = presenter.presentedViewController as? UIAlertController else { + MTKRecordFailure(withMessage: failureMessage, description: "No alert was presented.", file: file, line: line) + return + } + + guard alert.preferredStyle == style else { + MTKRecordFailure(withMessage: failureMessage, description: "Expected alert to have style `\(style)`. Instead found `\(alert.preferredStyle)`.", file: file, line: line) + return + } + + guard alert.title == title else { + MTKRecordFailure(withMessage: failureMessage, description: "Expected alert to have title \(quotedString(title)). Instead found \(quotedString(alert.title)).", file: file, line: line) + return + } + + guard alert.message == message else { + MTKRecordFailure(withMessage: failureMessage, description: "Expected alert to have message \(quotedString(message)). Instead found \(quotedString(alert.message)).", file: file, line: line) + return + } + + let doActionsMatchExpectedActions: Bool = { + + guard actions.count == alert.actions.count else { return false } + + for (expectedAction, actualAction) in zip(actions, alert.actions) where !expectedAction.matchesActualAction(actualAction) { + return false + } + + return true + }() + + guard doActionsMatchExpectedActions else { + + let expectedActionDescriptions = actions.map({ "(title: \"\($0.title)\", style: \($0.style))" }).commaSeparatedList() + + let actualActionDescriptions = alert.actions.map({ "(title: \(quotedString($0.title)), style: \($0.style))" }).commaSeparatedList() + + MTKRecordFailure(withMessage: failureMessage, description: "Expected alert to have actions: \(expectedActionDescriptions). Instead found \(actualActionDescriptions).", file: file, line: line) + + return + } +} + +// MARK: - ExpectedAlertAction + +/// A type used to represent an expected title and style for a `UIAlertAction` instance. +public struct ExpectedAlertAction { + + // MARK: Properties + + fileprivate let title: String + fileprivate let style: UIAlertActionStyle + + // MARK: Initialization + + public init(title: String, style: UIAlertActionStyle) { + + self.title = title + self.style = style + } + + // MARK: Action Comparison + + fileprivate func matchesActualAction(_ action: UIAlertAction) -> Bool { + + return title == action.title && style == action.style + } +} + +// MARK: - UIAlertControllerStyle: CustomStringConvertible + +extension UIAlertControllerStyle: CustomStringConvertible { + + public var description: String { + + switch self { + case .actionSheet: + return ".actionSheet" + case .alert: + return ".alert" + } + } +} + +// MARK: - UIAlertActionStyle: CustomStringConvertible + +extension UIAlertActionStyle: CustomStringConvertible { + + public var description: String { + + switch self { + case .default: + return ".default" + case .cancel: + return ".cancel" + case .destructive: + return ".destructive" + } + } +} diff --git a/MetovaTestKit/UIViewController+TestUtilities.swift b/MetovaTestKit/UIViewController+TestUtilities.swift new file mode 100644 index 0000000..3305e04 --- /dev/null +++ b/MetovaTestKit/UIViewController+TestUtilities.swift @@ -0,0 +1,18 @@ +// +// UIViewController+TestUtilities.swift +// MetovaTestKit +// +// Created by Logan Gauthier on 6/27/17. +// Copyright © 2017 Metova. All rights reserved. +// + +import Foundation + +extension UIViewController { + + /// Sets this view controller as the root view controller of the key window. + public func addToWindow() { + + UIApplication.shared.keyWindow?.rootViewController = self + } +} diff --git a/MetovaTestKitTests/MTKBaseTestCase.swift b/MetovaTestKitTests/MTKBaseTestCase.swift index 9f4ab4b..518a403 100644 --- a/MetovaTestKitTests/MTKBaseTestCase.swift +++ b/MetovaTestKitTests/MTKBaseTestCase.swift @@ -53,15 +53,33 @@ struct TestFailureExpectation { class MTKBaseTestCase: XCTestCase { private var expectingFailure: TestFailureExpectation? + private var descriptionForUnexpectedFailure: String? override func recordFailure(withDescription description: String, inFile filePath: String, atLine lineNumber: UInt, expected: Bool) { - if let expectedFailure = expectingFailure, expected - && (expectedFailure.description == nil || description == expectedFailure.description) - && (expectedFailure.filePath == nil || expectedFailure.filePath == filePath) - && (expectedFailure.lineNumber == nil || expectedFailure.lineNumber == lineNumber) { + if let expectedFailure = expectingFailure, expected { - expectingFailure = nil + var descriptionsForUnexpectedFailures = [String]() + + if let expectedFailureDescription = expectedFailure.description, description != expectedFailureDescription { + descriptionsForUnexpectedFailures.append("Description mismatch - Expected: `\(expectedFailureDescription)` Actual: `\(description)`.") + } + + if let expectedFailureFilePath = expectedFailure.filePath, filePath != expectedFailureFilePath { + descriptionsForUnexpectedFailures.append("File Path mismatch - Expected: \(expectedFailureFilePath) Actual: \(filePath).") + } + + if let expectedFailureLineNumber = expectedFailure.lineNumber, lineNumber != expectedFailureLineNumber { + descriptionsForUnexpectedFailures.append("Line Number mismatch - Expected: \(expectedFailureLineNumber) Actual: \(lineNumber).") + } + + if descriptionsForUnexpectedFailures.isEmpty { + expectingFailure = nil + } + else { + descriptionForUnexpectedFailure = descriptionsForUnexpectedFailures.joined(separator: " ") + super.recordFailure(withDescription: description, inFile: filePath, atLine: lineNumber, expected: true) + } } else { super.recordFailure(withDescription: description, inFile: filePath, atLine: lineNumber, expected: expected) @@ -75,7 +93,8 @@ class MTKBaseTestCase: XCTestCase { if expectingFailure != nil { expectingFailure = nil - let message = message() ?? "Failed to catch test failure in block." + let message = [message(), descriptionForUnexpectedFailure].flatMap({ $0 }).joined(separator: " ") + descriptionForUnexpectedFailure = nil XCTFail(message, file: file, line: line) } } diff --git a/MetovaTestKitTests/QuotedStringTests.swift b/MetovaTestKitTests/QuotedStringTests.swift new file mode 100644 index 0000000..35e9ac2 --- /dev/null +++ b/MetovaTestKitTests/QuotedStringTests.swift @@ -0,0 +1,20 @@ +// +// QuotedStringTests.swift +// MetovaTestKit +// +// Created by Logan Gauthier on 7/11/17. +// Copyright © 2017 Metova. All rights reserved. +// + +import XCTest + +@testable import MetovaTestKit + +class QuotedStringTests: MTKBaseTestCase { + + func testQuotedString() { + + XCTAssertEqual(quotedString("value"), "\"value\"") + XCTAssertEqual(quotedString(nil), "nil") + } +} diff --git a/MetovaTestKitTests/UISegmentedControlTestingTests.swift b/MetovaTestKitTests/UISegmentedControlTestingTests.swift index 5d80f1c..e547c19 100644 --- a/MetovaTestKitTests/UISegmentedControlTestingTests.swift +++ b/MetovaTestKitTests/UISegmentedControlTestingTests.swift @@ -43,7 +43,7 @@ class UISegmentedControlTestingTests: MTKBaseTestCase { let segmentedControl = UISegmentedControl(items: ["Title 1", "Title 2"]) - let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: \"Title 1\". Instead found \"Title 1\", and \"Title 2\".", filePath: #file) + let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: [\"Title 1\"]. Instead found [\"Title 1\", \"Title 2\"].", filePath: #file) expectTestFailure(failureExpectation, message: "The control has an extra title that we're not expecting.") { MTKAssertSegmentedControl(segmentedControl, hasSegmentTitles: ["Title 1"]) @@ -54,7 +54,7 @@ class UISegmentedControlTestingTests: MTKBaseTestCase { let segmentedControl = UISegmentedControl(items: ["Title 1"]) - let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: \"Title 1\", and \"Title 2\". Instead found \"Title 1\".", filePath: #file) + let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: [\"Title 1\", \"Title 2\"]. Instead found [\"Title 1\"].", filePath: #file) expectTestFailure(failureExpectation, message: "The control is missing a title that we're expecting.") { MTKAssertSegmentedControl(segmentedControl, hasSegmentTitles: ["Title 1", "Title 2"]) @@ -65,7 +65,7 @@ class UISegmentedControlTestingTests: MTKBaseTestCase { let segmentedControl = UISegmentedControl(items: ["Title 1", "Title 2"]) - let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: \"Title 1\", and \"Different Title\". Instead found \"Title 1\", and \"Title 2\".", filePath: #file) + let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: [\"Title 1\", \"Different Title\"]. Instead found [\"Title 1\", \"Title 2\"].", filePath: #file) expectTestFailure(failureExpectation, message: "One of the titles is different from the one we're expecting.") { MTKAssertSegmentedControl(segmentedControl, hasSegmentTitles: ["Title 1", "Different Title"]) @@ -76,7 +76,7 @@ class UISegmentedControlTestingTests: MTKBaseTestCase { let segmentedControl = UISegmentedControl(items: ["Title 1", "Title 2"]) - let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: \"Title 2\", and \"Title 1\". Instead found \"Title 1\", and \"Title 2\".", filePath: #file) + let failureExpectation = TestFailureExpectation(description: "failed - Expected segmented control to have segment titles: [\"Title 2\", \"Title 1\"]. Instead found [\"Title 1\", \"Title 2\"].", filePath: #file) expectTestFailure(failureExpectation, message: "The titles are in a different order than what we're expecting.") { MTKAssertSegmentedControl(segmentedControl, hasSegmentTitles: ["Title 2", "Title 1"]) diff --git a/README.md b/README.md index 263d084..086d311 100755 --- a/README.md +++ b/README.md @@ -74,6 +74,23 @@ With a single assertion, you can verify that your control actions are hooked up MTKAssertControl(testVC.loginButton, sends: #selector(LoginViewController.didTapLoginButton(_:)), to: testVC, for: .touchUpInside, "The login button should be hooked up to the login action.") ``` +##### UIAlertController + +Verify that a view controller presented an alert having a particular style, title, message, and actions. + +```swift +MTKAssertAlertIsPresented( + by: testVC, + style: .alert, + title: "Warning", + message: "Are you sure you want to delete this user?", + actions: [ + ExpectedAlertAction(title: "Delete", style: .destructive), + ExpectedAlertAction(title: "Cancel", style: .cancel) + ] +) +``` + ##### UISegmentedControl Verify that a `UISegmentedControl` has the segment titles you are expecting. From bee32811f9148973dd4926c187de873d59d89ffd Mon Sep 17 00:00:00 2001 From: Logan Gauthier Date: Wed, 12 Jul 2017 17:56:14 -0500 Subject: [PATCH 2/6] Add a README for the HostedTests target to document its purpose. --- HostedTests/README.md | 13 +++++++++++++ MetovaTestKit.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 HostedTests/README.md diff --git a/HostedTests/README.md b/HostedTests/README.md new file mode 100644 index 0000000..2decd67 --- /dev/null +++ b/HostedTests/README.md @@ -0,0 +1,13 @@ +----- + +### What Is This "Hostedtests" Target For? + +When creating a test target for testing a framework, you will usually want to select the framework for the "Target to be Tested" field. This is how the "MetovaTestKitTests" target is set up. However, MetovaTestKit has some features that can only be tested within the context of a UIKit app. + +### MetovaTestKit Components Tested by "HostedTests" + +| Component | Why It Must Be Tested in the Context of a Host Application | +|--------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `MTKAssertAlertIsPresented(by:style:title:message:actions:)` | This assertion checks to see if a view controller has presented a particular alert. A view controller can only present another view controller if it is added to the window. The "HostApplicationForTesting" target provides the window in which our test view controller can present alerts in the test suite. | + +----- diff --git a/MetovaTestKit.xcodeproj/project.pbxproj b/MetovaTestKit.xcodeproj/project.pbxproj index ab14041..987178a 100644 --- a/MetovaTestKit.xcodeproj/project.pbxproj +++ b/MetovaTestKit.xcodeproj/project.pbxproj @@ -116,6 +116,7 @@ 6E8D4B211EB941B9001284FD /* UISegmentedControlAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISegmentedControlAssertions.swift; path = UIKitTesting/UISegmentedControlAssertions.swift; sourceTree = ""; }; 6E8D4B231EB941F8001284FD /* Array+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+Utilities.swift"; path = "Internal/Array+Utilities.swift"; sourceTree = ""; }; 6E98F0BA1F15931D009C15FB /* QuotedStringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuotedStringTests.swift; sourceTree = ""; }; + 6E98F0BC1F16A330009C15FB /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 6EC1A6AF1EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+AsyncTesting.swift"; sourceTree = ""; }; 6EC1A6B21EBCE2E2000DEFA6 /* AsyncTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsyncTestingTests.swift; sourceTree = ""; }; 6ED689001EFC2D3C0040C243 /* UIAlertControllerAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIAlertControllerAssertions.swift; sourceTree = ""; }; @@ -303,6 +304,7 @@ children = ( 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */, 6E23682D1F043F5A008E3231 /* Info.plist */, + 6E98F0BC1F16A330009C15FB /* README.md */, ); path = HostedTests; sourceTree = ""; From 26d640a0a2c59c24a183da47c8330e692fdbaac0 Mon Sep 17 00:00:00 2001 From: Logan Gauthier Date: Wed, 12 Jul 2017 18:12:02 -0500 Subject: [PATCH 3/6] Remove unnecessary files, and add missing license comment headers. --- HostApplicationForTesting/AppDelegate.swift | 25 +++++++ .../AppIcon.appiconset/Contents.json | 68 ------------------- .../Base.lproj/LaunchScreen.storyboard | 27 -------- .../Base.lproj/Main.storyboard | 26 ------- HostApplicationForTesting/Info.plist | 4 -- .../ViewController.swift | 11 --- .../UIAlertControllerTestingTests.swift | 21 ++++++ MetovaTestKit.xcodeproj/project.pbxproj | 43 ++---------- MetovaTestKit/QuotedString.swift | 21 ++++++ .../UIAlertControllerAssertions.swift | 21 ++++++ MetovaTestKitTests/QuotedStringTests.swift | 21 ++++++ 11 files changed, 114 insertions(+), 174 deletions(-) delete mode 100644 HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard delete mode 100644 HostApplicationForTesting/Base.lproj/Main.storyboard delete mode 100644 HostApplicationForTesting/ViewController.swift diff --git a/HostApplicationForTesting/AppDelegate.swift b/HostApplicationForTesting/AppDelegate.swift index dede6f2..59624e7 100644 --- a/HostApplicationForTesting/AppDelegate.swift +++ b/HostApplicationForTesting/AppDelegate.swift @@ -5,6 +5,27 @@ // Created by Logan Gauthier on 6/28/17. // Copyright © 2017 Metova. All rights reserved. // +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// import UIKit @@ -15,6 +36,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + window = UIWindow(frame: UIScreen.main.bounds) + window?.rootViewController = UIViewController() + window?.makeKeyAndVisible() + return true } } diff --git a/HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json b/HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 36d2c80..0000000 --- a/HostApplicationForTesting/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard b/HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index fdf3f97..0000000 --- a/HostApplicationForTesting/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/HostApplicationForTesting/Base.lproj/Main.storyboard b/HostApplicationForTesting/Base.lproj/Main.storyboard deleted file mode 100644 index 273375f..0000000 --- a/HostApplicationForTesting/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/HostApplicationForTesting/Info.plist b/HostApplicationForTesting/Info.plist index d052473..e5baf19 100644 --- a/HostApplicationForTesting/Info.plist +++ b/HostApplicationForTesting/Info.plist @@ -20,10 +20,6 @@ 1 LSRequiresIPhoneOS - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main UIRequiredDeviceCapabilities armv7 diff --git a/HostApplicationForTesting/ViewController.swift b/HostApplicationForTesting/ViewController.swift deleted file mode 100644 index f12d534..0000000 --- a/HostApplicationForTesting/ViewController.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// ViewController.swift -// HostApplicationForTesting -// -// Created by Logan Gauthier on 6/28/17. -// Copyright © 2017 Metova. All rights reserved. -// - -import UIKit - -class ViewController: UIViewController { } diff --git a/HostedTests/UIAlertControllerTestingTests.swift b/HostedTests/UIAlertControllerTestingTests.swift index ed99a96..52f7158 100644 --- a/HostedTests/UIAlertControllerTestingTests.swift +++ b/HostedTests/UIAlertControllerTestingTests.swift @@ -5,6 +5,27 @@ // Created by Logan Gauthier on 6/28/17. // Copyright © 2017 Metova. All rights reserved. // +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// import XCTest import MetovaTestKit diff --git a/MetovaTestKit.xcodeproj/project.pbxproj b/MetovaTestKit.xcodeproj/project.pbxproj index 987178a..f2f5811 100644 --- a/MetovaTestKit.xcodeproj/project.pbxproj +++ b/MetovaTestKit.xcodeproj/project.pbxproj @@ -26,10 +26,6 @@ 4A8AD4F41CDEB7A60085984D /* TestableProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8AD4F31CDEB7A60085984D /* TestableProtocolTests.swift */; }; 6E23680A1F035295008E3231 /* UIViewController+TestUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */; }; 6E2368161F043F37008E3231 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368151F043F37008E3231 /* AppDelegate.swift */; }; - 6E2368181F043F37008E3231 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368171F043F37008E3231 /* ViewController.swift */; }; - 6E23681B1F043F37008E3231 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E2368191F043F37008E3231 /* Main.storyboard */; }; - 6E23681D1F043F37008E3231 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6E23681C1F043F37008E3231 /* Assets.xcassets */; }; - 6E2368201F043F37008E3231 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E23681E1F043F37008E3231 /* LaunchScreen.storyboard */; }; 6E23682C1F043F5A008E3231 /* UIAlertControllerTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */; }; 6E2368331F0440EF008E3231 /* MTKBaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A771FC81D4D534200EFD0B8 /* MTKBaseTestCase.swift */; }; 6E2368341F045FFD008E3231 /* MetovaTestKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A3CFEF71CDD5F37003EF6F0 /* MetovaTestKit.framework */; }; @@ -99,10 +95,6 @@ 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+TestUtilities.swift"; sourceTree = ""; }; 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HostApplicationForTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6E2368151F043F37008E3231 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6E2368171F043F37008E3231 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 6E23681A1F043F37008E3231 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 6E23681C1F043F37008E3231 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 6E23681F1F043F37008E3231 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 6E2368211F043F37008E3231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6E2368291F043F5A008E3231 /* HostedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HostedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIAlertControllerTestingTests.swift; sourceTree = ""; }; @@ -290,10 +282,6 @@ isa = PBXGroup; children = ( 6E2368151F043F37008E3231 /* AppDelegate.swift */, - 6E2368171F043F37008E3231 /* ViewController.swift */, - 6E2368191F043F37008E3231 /* Main.storyboard */, - 6E23681C1F043F37008E3231 /* Assets.xcassets */, - 6E23681E1F043F37008E3231 /* LaunchScreen.storyboard */, 6E2368211F043F37008E3231 /* Info.plist */, ); path = HostApplicationForTesting; @@ -482,7 +470,7 @@ }; 6E2368121F043F37008E3231 = { CreatedOnToolsVersion = 8.3.3; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; 6E2368281F043F59008E3231 = { CreatedOnToolsVersion = 8.3.3; @@ -532,9 +520,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E2368201F043F37008E3231 /* LaunchScreen.storyboard in Resources */, - 6E23681D1F043F37008E3231 /* Assets.xcassets in Resources */, - 6E23681B1F043F37008E3231 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -621,7 +606,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 6E2368181F043F37008E3231 /* ViewController.swift in Sources */, 6E2368161F043F37008E3231 /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -650,25 +634,6 @@ }; /* End PBXTargetDependency section */ -/* Begin PBXVariantGroup section */ - 6E2368191F043F37008E3231 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6E23681A1F043F37008E3231 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 6E23681E1F043F37008E3231 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 6E23681F1F043F37008E3231 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ 4A3CFF091CDD5F37003EF6F0 /* Debug */ = { isa = XCBuildConfiguration; @@ -848,14 +813,15 @@ 6E2368231F043F37008E3231 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = HostApplicationForTesting/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostApplicationForTesting; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 3.0; }; @@ -864,14 +830,15 @@ 6E2368241F043F37008E3231 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = HostApplicationForTesting/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostApplicationForTesting; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_VERSION = 3.0; }; name = Release; diff --git a/MetovaTestKit/QuotedString.swift b/MetovaTestKit/QuotedString.swift index 97ba7e6..c0d06b8 100644 --- a/MetovaTestKit/QuotedString.swift +++ b/MetovaTestKit/QuotedString.swift @@ -5,6 +5,27 @@ // Created by Logan Gauthier on 6/28/17. // Copyright © 2017 Metova. All rights reserved. // +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// import Foundation diff --git a/MetovaTestKit/UIAlertControllerAssertions.swift b/MetovaTestKit/UIAlertControllerAssertions.swift index 8db902f..b494205 100644 --- a/MetovaTestKit/UIAlertControllerAssertions.swift +++ b/MetovaTestKit/UIAlertControllerAssertions.swift @@ -5,6 +5,27 @@ // Created by Logan Gauthier on 6/22/17. // Copyright © 2017 Metova. All rights reserved. // +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// import Foundation diff --git a/MetovaTestKitTests/QuotedStringTests.swift b/MetovaTestKitTests/QuotedStringTests.swift index 35e9ac2..385708e 100644 --- a/MetovaTestKitTests/QuotedStringTests.swift +++ b/MetovaTestKitTests/QuotedStringTests.swift @@ -5,6 +5,27 @@ // Created by Logan Gauthier on 7/11/17. // Copyright © 2017 Metova. All rights reserved. // +// MIT License +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// import XCTest From 2db24d40cc777a7101f275cccbc833151bc75da4 Mon Sep 17 00:00:00 2001 From: Logan Gauthier Date: Wed, 12 Jul 2017 19:03:38 -0500 Subject: [PATCH 4/6] Make directory structure match project group structure. --- MetovaTestKit.xcodeproj/project.pbxproj | 30 +++++++++---------- .../Array+Utilities.swift | 0 .../FailureRecording.swift | 0 .../QuotedString.swift | 0 .../UIViewController+TestUtilities.swift | 0 .../MTKTestable+UIViewController.swift | 0 .../MTKTestable.swift | 0 .../UIAlertControllerAssertions.swift | 0 .../AsyncTestingTests.swift | 0 .../FailureRecordingTests.swift | 0 .../QuotedStringTests.swift | 0 .../MTKBaseTestCase.swift | 0 .../TestableViewController.swift | 0 .../TestableViewController.xib | 0 .../UIControlTestingTests.swift | 0 .../UISegmentedControlTestingTests.swift | 0 16 files changed, 15 insertions(+), 15 deletions(-) rename MetovaTestKit/{Internal => Internal Utilities}/Array+Utilities.swift (100%) rename MetovaTestKit/{Internal => Internal Utilities}/FailureRecording.swift (100%) rename MetovaTestKit/{ => Internal Utilities}/QuotedString.swift (100%) rename MetovaTestKit/{ => Test Setup Utilities}/UIViewController+TestUtilities.swift (100%) rename MetovaTestKit/{ViewControllerTesting => Testable}/MTKTestable+UIViewController.swift (100%) rename MetovaTestKit/{ViewControllerTesting => Testable}/MTKTestable.swift (100%) rename MetovaTestKit/{ => UIKitTesting}/UIAlertControllerAssertions.swift (100%) rename MetovaTestKitTests/{ => Asynchronous Testing Tests}/AsyncTestingTests.swift (100%) rename MetovaTestKitTests/{ => Internal Utilities Tests}/FailureRecordingTests.swift (100%) rename MetovaTestKitTests/{ => Internal Utilities Tests}/QuotedStringTests.swift (100%) rename MetovaTestKitTests/{ => Supporting Test Files}/MTKBaseTestCase.swift (100%) rename MetovaTestKitTests/{SupportingTestFiles => Test Data}/TestableViewController.swift (100%) rename MetovaTestKitTests/{SupportingTestFiles => Test Data}/TestableViewController.xib (100%) rename MetovaTestKitTests/{ => UIKit Testing Tests}/UIControlTestingTests.swift (100%) rename MetovaTestKitTests/{ => UIKit Testing Tests}/UISegmentedControlTestingTests.swift (100%) diff --git a/MetovaTestKit.xcodeproj/project.pbxproj b/MetovaTestKit.xcodeproj/project.pbxproj index f2f5811..f241f98 100644 --- a/MetovaTestKit.xcodeproj/project.pbxproj +++ b/MetovaTestKit.xcodeproj/project.pbxproj @@ -82,37 +82,37 @@ 4A771F2F1D4C144400EFD0B8 /* MTKBrokenConstraintCounter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MTKBrokenConstraintCounter.m; path = ConstraintTesting/MTKBrokenConstraintCounter.m; sourceTree = ""; }; 4A771F321D4C155700EFD0B8 /* MTKConstraintTester.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MTKConstraintTester.swift; path = ConstraintTesting/MTKConstraintTester.swift; sourceTree = ""; }; 4A771F341D4C173300EFD0B8 /* ConstraintTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConstraintTestingTests.swift; sourceTree = ""; }; - 4A771FC81D4D534200EFD0B8 /* MTKBaseTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MTKBaseTestCase.swift; sourceTree = ""; }; - 4A8AD4E81CDEA2A30085984D /* MTKTestable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MTKTestable.swift; path = ViewControllerTesting/MTKTestable.swift; sourceTree = ""; }; + 4A771FC81D4D534200EFD0B8 /* MTKBaseTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MTKBaseTestCase.swift; path = "Supporting Test Files/MTKBaseTestCase.swift"; sourceTree = ""; }; + 4A8AD4E81CDEA2A30085984D /* MTKTestable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MTKTestable.swift; path = Testable/MTKTestable.swift; sourceTree = ""; }; 4A8AD4EA1CDEA2B60085984D /* MTKExceptionTesting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MTKExceptionTesting.swift; path = ExceptionTesting/MTKExceptionTesting.swift; sourceTree = ""; }; - 4A8AD4EC1CDEA53A0085984D /* MTKTestable+UIViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MTKTestable+UIViewController.swift"; path = "ViewControllerTesting/MTKTestable+UIViewController.swift"; sourceTree = ""; }; - 4A8AD4EF1CDEB6C30085984D /* TestableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestableViewController.swift; path = SupportingTestFiles/TestableViewController.swift; sourceTree = ""; }; - 4A8AD4F01CDEB6C30085984D /* TestableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = TestableViewController.xib; path = SupportingTestFiles/TestableViewController.xib; sourceTree = ""; }; + 4A8AD4EC1CDEA53A0085984D /* MTKTestable+UIViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "MTKTestable+UIViewController.swift"; path = "Testable/MTKTestable+UIViewController.swift"; sourceTree = ""; }; + 4A8AD4EF1CDEB6C30085984D /* TestableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestableViewController.swift; path = "Test Data/TestableViewController.swift"; sourceTree = ""; }; + 4A8AD4F01CDEB6C30085984D /* TestableViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = TestableViewController.xib; path = "Test Data/TestableViewController.xib"; sourceTree = ""; }; 4A8AD4F31CDEB7A60085984D /* TestableProtocolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestableProtocolTests.swift; sourceTree = ""; }; 4A8AD4F51CDEDF110085984D /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; }; 4A8AD4F71CDEE4220085984D /* .travis.yml */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; path = .travis.yml; sourceTree = ""; }; 4AB9A3E01CDF6AB00021B6B8 /* Gemfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; indentWidth = 2; path = Gemfile; sourceTree = ""; }; - 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+TestUtilities.swift"; sourceTree = ""; }; + 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIViewController+TestUtilities.swift"; path = "Test Setup Utilities/UIViewController+TestUtilities.swift"; sourceTree = ""; }; 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HostApplicationForTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; 6E2368151F043F37008E3231 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 6E2368211F043F37008E3231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6E2368291F043F5A008E3231 /* HostedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HostedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIAlertControllerTestingTests.swift; sourceTree = ""; }; 6E23682D1F043F5A008E3231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6E2368351F046B26008E3231 /* QuotedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuotedString.swift; sourceTree = ""; }; - 6E8D4B071EB7C5DF001284FD /* FailureRecording.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FailureRecording.swift; path = Internal/FailureRecording.swift; sourceTree = ""; }; - 6E8D4B0B1EB7CF67001284FD /* UIControlTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIControlTestingTests.swift; sourceTree = ""; }; + 6E2368351F046B26008E3231 /* QuotedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuotedString.swift; path = "Internal Utilities/QuotedString.swift"; sourceTree = ""; }; + 6E8D4B071EB7C5DF001284FD /* FailureRecording.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FailureRecording.swift; path = "Internal Utilities/FailureRecording.swift"; sourceTree = ""; }; + 6E8D4B0B1EB7CF67001284FD /* UIControlTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIControlTestingTests.swift; path = "UIKit Testing Tests/UIControlTestingTests.swift"; sourceTree = ""; }; 6E8D4B181EB8138B001284FD /* UIControlAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIControlAssertions.swift; path = UIKitTesting/UIControlAssertions.swift; sourceTree = ""; }; 6E8D4B1A1EB8154A001284FD /* .ruby-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".ruby-version"; sourceTree = ""; }; - 6E8D4B1D1EB8D660001284FD /* FailureRecordingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FailureRecordingTests.swift; sourceTree = ""; }; + 6E8D4B1D1EB8D660001284FD /* FailureRecordingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FailureRecordingTests.swift; path = "Internal Utilities Tests/FailureRecordingTests.swift"; sourceTree = ""; }; 6E8D4B211EB941B9001284FD /* UISegmentedControlAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISegmentedControlAssertions.swift; path = UIKitTesting/UISegmentedControlAssertions.swift; sourceTree = ""; }; - 6E8D4B231EB941F8001284FD /* Array+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+Utilities.swift"; path = "Internal/Array+Utilities.swift"; sourceTree = ""; }; - 6E98F0BA1F15931D009C15FB /* QuotedStringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuotedStringTests.swift; sourceTree = ""; }; + 6E8D4B231EB941F8001284FD /* Array+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+Utilities.swift"; path = "Internal Utilities/Array+Utilities.swift"; sourceTree = ""; }; + 6E98F0BA1F15931D009C15FB /* QuotedStringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuotedStringTests.swift; path = "Internal Utilities Tests/QuotedStringTests.swift"; sourceTree = ""; }; 6E98F0BC1F16A330009C15FB /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 6EC1A6AF1EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+AsyncTesting.swift"; sourceTree = ""; }; - 6EC1A6B21EBCE2E2000DEFA6 /* AsyncTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AsyncTestingTests.swift; sourceTree = ""; }; - 6ED689001EFC2D3C0040C243 /* UIAlertControllerAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIAlertControllerAssertions.swift; sourceTree = ""; }; - 6EF9B23A1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UISegmentedControlTestingTests.swift; sourceTree = ""; }; + 6EC1A6B21EBCE2E2000DEFA6 /* AsyncTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AsyncTestingTests.swift; path = "Asynchronous Testing Tests/AsyncTestingTests.swift"; sourceTree = ""; }; + 6ED689001EFC2D3C0040C243 /* UIAlertControllerAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIAlertControllerAssertions.swift; path = UIKitTesting/UIAlertControllerAssertions.swift; sourceTree = ""; }; + 6EF9B23A1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISegmentedControlTestingTests.swift; path = "UIKit Testing Tests/UISegmentedControlTestingTests.swift"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ diff --git a/MetovaTestKit/Internal/Array+Utilities.swift b/MetovaTestKit/Internal Utilities/Array+Utilities.swift similarity index 100% rename from MetovaTestKit/Internal/Array+Utilities.swift rename to MetovaTestKit/Internal Utilities/Array+Utilities.swift diff --git a/MetovaTestKit/Internal/FailureRecording.swift b/MetovaTestKit/Internal Utilities/FailureRecording.swift similarity index 100% rename from MetovaTestKit/Internal/FailureRecording.swift rename to MetovaTestKit/Internal Utilities/FailureRecording.swift diff --git a/MetovaTestKit/QuotedString.swift b/MetovaTestKit/Internal Utilities/QuotedString.swift similarity index 100% rename from MetovaTestKit/QuotedString.swift rename to MetovaTestKit/Internal Utilities/QuotedString.swift diff --git a/MetovaTestKit/UIViewController+TestUtilities.swift b/MetovaTestKit/Test Setup Utilities/UIViewController+TestUtilities.swift similarity index 100% rename from MetovaTestKit/UIViewController+TestUtilities.swift rename to MetovaTestKit/Test Setup Utilities/UIViewController+TestUtilities.swift diff --git a/MetovaTestKit/ViewControllerTesting/MTKTestable+UIViewController.swift b/MetovaTestKit/Testable/MTKTestable+UIViewController.swift similarity index 100% rename from MetovaTestKit/ViewControllerTesting/MTKTestable+UIViewController.swift rename to MetovaTestKit/Testable/MTKTestable+UIViewController.swift diff --git a/MetovaTestKit/ViewControllerTesting/MTKTestable.swift b/MetovaTestKit/Testable/MTKTestable.swift similarity index 100% rename from MetovaTestKit/ViewControllerTesting/MTKTestable.swift rename to MetovaTestKit/Testable/MTKTestable.swift diff --git a/MetovaTestKit/UIAlertControllerAssertions.swift b/MetovaTestKit/UIKitTesting/UIAlertControllerAssertions.swift similarity index 100% rename from MetovaTestKit/UIAlertControllerAssertions.swift rename to MetovaTestKit/UIKitTesting/UIAlertControllerAssertions.swift diff --git a/MetovaTestKitTests/AsyncTestingTests.swift b/MetovaTestKitTests/Asynchronous Testing Tests/AsyncTestingTests.swift similarity index 100% rename from MetovaTestKitTests/AsyncTestingTests.swift rename to MetovaTestKitTests/Asynchronous Testing Tests/AsyncTestingTests.swift diff --git a/MetovaTestKitTests/FailureRecordingTests.swift b/MetovaTestKitTests/Internal Utilities Tests/FailureRecordingTests.swift similarity index 100% rename from MetovaTestKitTests/FailureRecordingTests.swift rename to MetovaTestKitTests/Internal Utilities Tests/FailureRecordingTests.swift diff --git a/MetovaTestKitTests/QuotedStringTests.swift b/MetovaTestKitTests/Internal Utilities Tests/QuotedStringTests.swift similarity index 100% rename from MetovaTestKitTests/QuotedStringTests.swift rename to MetovaTestKitTests/Internal Utilities Tests/QuotedStringTests.swift diff --git a/MetovaTestKitTests/MTKBaseTestCase.swift b/MetovaTestKitTests/Supporting Test Files/MTKBaseTestCase.swift similarity index 100% rename from MetovaTestKitTests/MTKBaseTestCase.swift rename to MetovaTestKitTests/Supporting Test Files/MTKBaseTestCase.swift diff --git a/MetovaTestKitTests/SupportingTestFiles/TestableViewController.swift b/MetovaTestKitTests/Test Data/TestableViewController.swift similarity index 100% rename from MetovaTestKitTests/SupportingTestFiles/TestableViewController.swift rename to MetovaTestKitTests/Test Data/TestableViewController.swift diff --git a/MetovaTestKitTests/SupportingTestFiles/TestableViewController.xib b/MetovaTestKitTests/Test Data/TestableViewController.xib similarity index 100% rename from MetovaTestKitTests/SupportingTestFiles/TestableViewController.xib rename to MetovaTestKitTests/Test Data/TestableViewController.xib diff --git a/MetovaTestKitTests/UIControlTestingTests.swift b/MetovaTestKitTests/UIKit Testing Tests/UIControlTestingTests.swift similarity index 100% rename from MetovaTestKitTests/UIControlTestingTests.swift rename to MetovaTestKitTests/UIKit Testing Tests/UIControlTestingTests.swift diff --git a/MetovaTestKitTests/UISegmentedControlTestingTests.swift b/MetovaTestKitTests/UIKit Testing Tests/UISegmentedControlTestingTests.swift similarity index 100% rename from MetovaTestKitTests/UISegmentedControlTestingTests.swift rename to MetovaTestKitTests/UIKit Testing Tests/UISegmentedControlTestingTests.swift From 89bbc125577711aeac804b002a9712f3c114c27e Mon Sep 17 00:00:00 2001 From: Logan Gauthier Date: Thu, 13 Jul 2017 14:57:20 -0500 Subject: [PATCH 5/6] Use test window for alert controller assertion tests and remove HostedTests target. --- HostApplicationForTesting/AppDelegate.swift | 45 ---- HostApplicationForTesting/Info.plist | 41 --- HostedTests/Info.plist | 22 -- HostedTests/README.md | 13 - MetovaTestKit.xcodeproj/project.pbxproj | 238 +----------------- .../xcschemes/MetovaTestKit.xcscheme | 38 --- .../UIViewController+TestUtilities.swift | 18 -- .../MTKBaseTestCase.swift | 16 +- .../UIAlertControllerTestingTests.swift | 6 +- 9 files changed, 21 insertions(+), 416 deletions(-) delete mode 100644 HostApplicationForTesting/AppDelegate.swift delete mode 100644 HostApplicationForTesting/Info.plist delete mode 100644 HostedTests/Info.plist delete mode 100644 HostedTests/README.md delete mode 100644 MetovaTestKit/Test Setup Utilities/UIViewController+TestUtilities.swift rename {HostedTests => MetovaTestKitTests/UIKit Testing Tests}/UIAlertControllerTestingTests.swift (99%) diff --git a/HostApplicationForTesting/AppDelegate.swift b/HostApplicationForTesting/AppDelegate.swift deleted file mode 100644 index 59624e7..0000000 --- a/HostApplicationForTesting/AppDelegate.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// AppDelegate.swift -// HostApplicationForTesting -// -// Created by Logan Gauthier on 6/28/17. -// Copyright © 2017 Metova. All rights reserved. -// -// MIT License -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - - window = UIWindow(frame: UIScreen.main.bounds) - window?.rootViewController = UIViewController() - window?.makeKeyAndVisible() - - return true - } -} diff --git a/HostApplicationForTesting/Info.plist b/HostApplicationForTesting/Info.plist deleted file mode 100644 index e5baf19..0000000 --- a/HostApplicationForTesting/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/HostedTests/Info.plist b/HostedTests/Info.plist deleted file mode 100644 index 6c6c23c..0000000 --- a/HostedTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/HostedTests/README.md b/HostedTests/README.md deleted file mode 100644 index 2decd67..0000000 --- a/HostedTests/README.md +++ /dev/null @@ -1,13 +0,0 @@ ------ - -### What Is This "Hostedtests" Target For? - -When creating a test target for testing a framework, you will usually want to select the framework for the "Target to be Tested" field. This is how the "MetovaTestKitTests" target is set up. However, MetovaTestKit has some features that can only be tested within the context of a UIKit app. - -### MetovaTestKit Components Tested by "HostedTests" - -| Component | Why It Must Be Tested in the Context of a Host Application | -|--------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `MTKAssertAlertIsPresented(by:style:title:message:actions:)` | This assertion checks to see if a view controller has presented a particular alert. A view controller can only present another view controller if it is added to the window. The "HostApplicationForTesting" target provides the window in which our test view controller can present alerts in the test suite. | - ------ diff --git a/MetovaTestKit.xcodeproj/project.pbxproj b/MetovaTestKit.xcodeproj/project.pbxproj index f241f98..a32e147 100644 --- a/MetovaTestKit.xcodeproj/project.pbxproj +++ b/MetovaTestKit.xcodeproj/project.pbxproj @@ -24,12 +24,8 @@ 4A8AD4F11CDEB6C30085984D /* TestableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8AD4EF1CDEB6C30085984D /* TestableViewController.swift */; }; 4A8AD4F21CDEB6C30085984D /* TestableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4A8AD4F01CDEB6C30085984D /* TestableViewController.xib */; }; 4A8AD4F41CDEB7A60085984D /* TestableProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A8AD4F31CDEB7A60085984D /* TestableProtocolTests.swift */; }; - 6E23680A1F035295008E3231 /* UIViewController+TestUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */; }; - 6E2368161F043F37008E3231 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368151F043F37008E3231 /* AppDelegate.swift */; }; - 6E23682C1F043F5A008E3231 /* UIAlertControllerTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */; }; - 6E2368331F0440EF008E3231 /* MTKBaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A771FC81D4D534200EFD0B8 /* MTKBaseTestCase.swift */; }; - 6E2368341F045FFD008E3231 /* MetovaTestKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A3CFEF71CDD5F37003EF6F0 /* MetovaTestKit.framework */; }; 6E2368361F046B26008E3231 /* QuotedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2368351F046B26008E3231 /* QuotedString.swift */; }; + 6E2616EC1F18060200D9B507 /* UIAlertControllerTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E2616EB1F18060200D9B507 /* UIAlertControllerTestingTests.swift */; }; 6E8D4B081EB7C5DF001284FD /* FailureRecording.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B071EB7C5DF001284FD /* FailureRecording.swift */; }; 6E8D4B0C1EB7CF68001284FD /* UIControlTestingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B0B1EB7CF67001284FD /* UIControlTestingTests.swift */; }; 6E8D4B191EB8138B001284FD /* UIControlAssertions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E8D4B181EB8138B001284FD /* UIControlAssertions.swift */; }; @@ -51,13 +47,6 @@ remoteGlobalIDString = 4A3CFEF61CDD5F37003EF6F0; remoteInfo = MetovaTestKit; }; - 6E23682E1F043F5A008E3231 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4A3CFEEE1CDD5F37003EF6F0 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6E2368121F043F37008E3231; - remoteInfo = HostApplicationForTesting; - }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -92,14 +81,8 @@ 4A8AD4F51CDEDF110085984D /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; }; 4A8AD4F71CDEE4220085984D /* .travis.yml */ = {isa = PBXFileReference; indentWidth = 2; lastKnownFileType = text; path = .travis.yml; sourceTree = ""; }; 4AB9A3E01CDF6AB00021B6B8 /* Gemfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; indentWidth = 2; path = Gemfile; sourceTree = ""; }; - 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIViewController+TestUtilities.swift"; path = "Test Setup Utilities/UIViewController+TestUtilities.swift"; sourceTree = ""; }; - 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HostApplicationForTesting.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6E2368151F043F37008E3231 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 6E2368211F043F37008E3231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6E2368291F043F5A008E3231 /* HostedTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HostedTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIAlertControllerTestingTests.swift; sourceTree = ""; }; - 6E23682D1F043F5A008E3231 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6E2368351F046B26008E3231 /* QuotedString.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuotedString.swift; path = "Internal Utilities/QuotedString.swift"; sourceTree = ""; }; + 6E2616EB1F18060200D9B507 /* UIAlertControllerTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIAlertControllerTestingTests.swift; path = "UIKit Testing Tests/UIAlertControllerTestingTests.swift"; sourceTree = ""; }; 6E8D4B071EB7C5DF001284FD /* FailureRecording.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FailureRecording.swift; path = "Internal Utilities/FailureRecording.swift"; sourceTree = ""; }; 6E8D4B0B1EB7CF67001284FD /* UIControlTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIControlTestingTests.swift; path = "UIKit Testing Tests/UIControlTestingTests.swift"; sourceTree = ""; }; 6E8D4B181EB8138B001284FD /* UIControlAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIControlAssertions.swift; path = UIKitTesting/UIControlAssertions.swift; sourceTree = ""; }; @@ -108,7 +91,6 @@ 6E8D4B211EB941B9001284FD /* UISegmentedControlAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UISegmentedControlAssertions.swift; path = UIKitTesting/UISegmentedControlAssertions.swift; sourceTree = ""; }; 6E8D4B231EB941F8001284FD /* Array+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "Array+Utilities.swift"; path = "Internal Utilities/Array+Utilities.swift"; sourceTree = ""; }; 6E98F0BA1F15931D009C15FB /* QuotedStringTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuotedStringTests.swift; path = "Internal Utilities Tests/QuotedStringTests.swift"; sourceTree = ""; }; - 6E98F0BC1F16A330009C15FB /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 6EC1A6AF1EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+AsyncTesting.swift"; sourceTree = ""; }; 6EC1A6B21EBCE2E2000DEFA6 /* AsyncTestingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AsyncTestingTests.swift; path = "Asynchronous Testing Tests/AsyncTestingTests.swift"; sourceTree = ""; }; 6ED689001EFC2D3C0040C243 /* UIAlertControllerAssertions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIAlertControllerAssertions.swift; path = UIKitTesting/UIAlertControllerAssertions.swift; sourceTree = ""; }; @@ -132,21 +114,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 6E2368101F043F37008E3231 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6E2368261F043F59008E3231 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 6E2368341F045FFD008E3231 /* MetovaTestKit.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -156,8 +123,6 @@ 4A3CFF111CDD600C003EF6F0 /* Related Files */, 4A3CFEF91CDD5F37003EF6F0 /* MetovaTestKit */, 4A3CFF051CDD5F37003EF6F0 /* MetovaTestKitTests */, - 6E2368141F043F37008E3231 /* HostApplicationForTesting */, - 6E23682A1F043F5A008E3231 /* HostedTests */, 4A3CFEF81CDD5F37003EF6F0 /* Products */, 4A3CFFCC1CDE1480003EF6F0 /* Dependencies */, ); @@ -168,8 +133,6 @@ children = ( 4A3CFEF71CDD5F37003EF6F0 /* MetovaTestKit.framework */, 4A3CFF011CDD5F37003EF6F0 /* MetovaTestKitTests.xctest */, - 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */, - 6E2368291F043F5A008E3231 /* HostedTests.xctest */, ); name = Products; sourceTree = ""; @@ -177,7 +140,6 @@ 4A3CFEF91CDD5F37003EF6F0 /* MetovaTestKit */ = { isa = PBXGroup; children = ( - 6E2368081F03527C008E3231 /* Test Setup Utilities */, 6EC1A6AE1EBCDD3F000DEFA6 /* AsynchronousTesting */, 6E8D4B041EB7AD1B001284FD /* Internal Utilities */, 6E8D4AFF1EB7AB70001284FD /* UIKitTesting */, @@ -270,33 +232,6 @@ name = "Supporting Test Files"; sourceTree = ""; }; - 6E2368081F03527C008E3231 /* Test Setup Utilities */ = { - isa = PBXGroup; - children = ( - 6E2368091F035295008E3231 /* UIViewController+TestUtilities.swift */, - ); - name = "Test Setup Utilities"; - sourceTree = ""; - }; - 6E2368141F043F37008E3231 /* HostApplicationForTesting */ = { - isa = PBXGroup; - children = ( - 6E2368151F043F37008E3231 /* AppDelegate.swift */, - 6E2368211F043F37008E3231 /* Info.plist */, - ); - path = HostApplicationForTesting; - sourceTree = ""; - }; - 6E23682A1F043F5A008E3231 /* HostedTests */ = { - isa = PBXGroup; - children = ( - 6E23682B1F043F5A008E3231 /* UIAlertControllerTestingTests.swift */, - 6E23682D1F043F5A008E3231 /* Info.plist */, - 6E98F0BC1F16A330009C15FB /* README.md */, - ); - path = HostedTests; - sourceTree = ""; - }; 6E8D4AFF1EB7AB70001284FD /* UIKitTesting */ = { isa = PBXGroup; children = ( @@ -322,6 +257,7 @@ children = ( 6E8D4B0B1EB7CF67001284FD /* UIControlTestingTests.swift */, 6EF9B23A1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift */, + 6E2616EB1F18060200D9B507 /* UIAlertControllerTestingTests.swift */, ); name = "UIKit Testing Tests"; sourceTree = ""; @@ -414,41 +350,6 @@ productReference = 4A3CFF011CDD5F37003EF6F0 /* MetovaTestKitTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 6E2368121F043F37008E3231 /* HostApplicationForTesting */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6E2368221F043F37008E3231 /* Build configuration list for PBXNativeTarget "HostApplicationForTesting" */; - buildPhases = ( - 6E23680F1F043F37008E3231 /* Sources */, - 6E2368101F043F37008E3231 /* Frameworks */, - 6E2368111F043F37008E3231 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = HostApplicationForTesting; - productName = HostApplicationForTesting; - productReference = 6E2368131F043F37008E3231 /* HostApplicationForTesting.app */; - productType = "com.apple.product-type.application"; - }; - 6E2368281F043F59008E3231 /* HostedTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6E2368301F043F5A008E3231 /* Build configuration list for PBXNativeTarget "HostedTests" */; - buildPhases = ( - 6E2368251F043F59008E3231 /* Sources */, - 6E2368261F043F59008E3231 /* Frameworks */, - 6E2368271F043F59008E3231 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6E23682F1F043F5A008E3231 /* PBXTargetDependency */, - ); - name = HostedTests; - productName = HostedTests; - productReference = 6E2368291F043F5A008E3231 /* HostedTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -468,15 +369,6 @@ CreatedOnToolsVersion = 7.3; LastSwiftMigration = 0800; }; - 6E2368121F043F37008E3231 = { - CreatedOnToolsVersion = 8.3.3; - ProvisioningStyle = Manual; - }; - 6E2368281F043F59008E3231 = { - CreatedOnToolsVersion = 8.3.3; - ProvisioningStyle = Automatic; - TestTargetID = 6E2368121F043F37008E3231; - }; }; }; buildConfigurationList = 4A3CFEF11CDD5F37003EF6F0 /* Build configuration list for PBXProject "MetovaTestKit" */; @@ -494,8 +386,6 @@ targets = ( 4A3CFEF61CDD5F37003EF6F0 /* MetovaTestKit */, 4A3CFF001CDD5F37003EF6F0 /* MetovaTestKitTests */, - 6E2368121F043F37008E3231 /* HostApplicationForTesting */, - 6E2368281F043F59008E3231 /* HostedTests */, ); }; /* End PBXProject section */ @@ -516,20 +406,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 6E2368111F043F37008E3231 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6E2368271F043F59008E3231 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -577,7 +453,6 @@ 4A8AD4ED1CDEA53A0085984D /* MTKTestable+UIViewController.swift in Sources */, 6E8D4B191EB8138B001284FD /* UIControlAssertions.swift in Sources */, 4A3CFF231CDD60CA003EF6F0 /* MTKExceptionTester.m in Sources */, - 6E23680A1F035295008E3231 /* UIViewController+TestUtilities.swift in Sources */, 6E8D4B221EB941B9001284FD /* UISegmentedControlAssertions.swift in Sources */, 6E8D4B081EB7C5DF001284FD /* FailureRecording.swift in Sources */, 6EC1A6B01EBCDDAF000DEFA6 /* XCTestCase+AsyncTesting.swift in Sources */, @@ -595,6 +470,7 @@ 4A771FC91D4D534200EFD0B8 /* MTKBaseTestCase.swift in Sources */, 6EF9B23B1EBBA65600B87FA3 /* UISegmentedControlTestingTests.swift in Sources */, 4A8AD4F41CDEB7A60085984D /* TestableProtocolTests.swift in Sources */, + 6E2616EC1F18060200D9B507 /* UIAlertControllerTestingTests.swift in Sources */, 6EC1A6B31EBCE2E2000DEFA6 /* AsyncTestingTests.swift in Sources */, 4A3CFFCE1CDE1548003EF6F0 /* ExceptionTestingTests.swift in Sources */, 6E8D4B0C1EB7CF68001284FD /* UIControlTestingTests.swift in Sources */, @@ -602,23 +478,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 6E23680F1F043F37008E3231 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6E2368161F043F37008E3231 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6E2368251F043F59008E3231 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6E23682C1F043F5A008E3231 /* UIAlertControllerTestingTests.swift in Sources */, - 6E2368331F0440EF008E3231 /* MTKBaseTestCase.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -627,11 +486,6 @@ target = 4A3CFEF61CDD5F37003EF6F0 /* MetovaTestKit */; targetProxy = 4A3CFF031CDD5F37003EF6F0 /* PBXContainerItemProxy */; }; - 6E23682F1F043F5A008E3231 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6E2368121F043F37008E3231 /* HostApplicationForTesting */; - targetProxy = 6E23682E1F043F5A008E3231 /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -810,72 +664,6 @@ }; name = Release; }; - 6E2368231F043F37008E3231 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = HostApplicationForTesting/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostApplicationForTesting; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; - }; - name = Debug; - }; - 6E2368241F043F37008E3231 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = HostApplicationForTesting/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostApplicationForTesting; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.0; - }; - name = Release; - }; - 6E2368311F043F5A008E3231 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - INFOPLIST_FILE = HostedTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostedTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HostApplicationForTesting.app/HostApplicationForTesting"; - }; - name = Debug; - }; - 6E2368321F043F5A008E3231 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - INFOPLIST_FILE = HostedTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 10.3; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.metova.HostedTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HostApplicationForTesting.app/HostApplicationForTesting"; - }; - name = Release; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -906,24 +694,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 6E2368221F043F37008E3231 /* Build configuration list for PBXNativeTarget "HostApplicationForTesting" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6E2368231F043F37008E3231 /* Debug */, - 6E2368241F043F37008E3231 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6E2368301F043F5A008E3231 /* Build configuration list for PBXNativeTarget "HostedTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6E2368311F043F5A008E3231 /* Debug */, - 6E2368321F043F5A008E3231 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; /* End XCConfigurationList section */ }; rootObject = 4A3CFEEE1CDD5F37003EF6F0 /* Project object */; diff --git a/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme b/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme index 0d601f4..02518fc 100644 --- a/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme +++ b/MetovaTestKit.xcodeproj/xcshareddata/xcschemes/MetovaTestKit.xcscheme @@ -34,34 +34,6 @@ ReferencedContainer = "container:MetovaTestKit.xcodeproj"> - - - - - - - - - - - - Date: Thu, 13 Jul 2017 15:02:29 -0500 Subject: [PATCH 6/6] Remove unnecessary utility method. --- MetovaTestKit/Internal Utilities/Array+Utilities.swift | 10 ---------- .../UIKitTesting/UISegmentedControlAssertions.swift | 2 +- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/MetovaTestKit/Internal Utilities/Array+Utilities.swift b/MetovaTestKit/Internal Utilities/Array+Utilities.swift index 4abe662..6c9d756 100644 --- a/MetovaTestKit/Internal Utilities/Array+Utilities.swift +++ b/MetovaTestKit/Internal Utilities/Array+Utilities.swift @@ -38,14 +38,4 @@ extension Sequence where Iterator.Element == String { return "[" + map({ "\($0)" }).joined(separator: ", ") + "]" } - - /// Convenience method for generating a comma separated list of items in qutoes. - /// - /// - Returns: A comma separated list of items where each item is surrounded by quotes. - func commaSeparatedQuotedList() -> String { - - let itemsInQuotes = map { "\"\($0)\"" } - - return itemsInQuotes.commaSeparatedList() - } } diff --git a/MetovaTestKit/UIKitTesting/UISegmentedControlAssertions.swift b/MetovaTestKit/UIKitTesting/UISegmentedControlAssertions.swift index e28a18b..ab62c1c 100644 --- a/MetovaTestKit/UIKitTesting/UISegmentedControlAssertions.swift +++ b/MetovaTestKit/UIKitTesting/UISegmentedControlAssertions.swift @@ -42,7 +42,7 @@ public func MTKAssertSegmentedControl(_ segmentedControl: UISegmentedControl, ha let actualTitles = Array(0..