Skip to content

Commit 76ece1f

Browse files
committed
add unit tests
1 parent e3628e7 commit 76ece1f

14 files changed

+136
-10
lines changed

Conjugar.xcodeproj/project.pbxproj

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
/* Begin PBXBuildFile section */
1010
035C646F22299A7E001ECC02 /* RatingsFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035C646E22299A7E001ECC02 /* RatingsFetcher.swift */; };
11+
038E03132270A868005CFC96 /* IntExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E03122270A868005CFC96 /* IntExtensionTests.swift */; };
12+
038E03152270A9FB005CFC96 /* TestGameCenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E03142270A9FB005CFC96 /* TestGameCenterTests.swift */; };
13+
038E03182270AC01005CFC96 /* DeviceUtilityTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E03172270AC01005CFC96 /* DeviceUtilityTests.swift */; };
14+
038E031A22711B76005CFC96 /* UIViewControllerExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 038E031922711B76005CFC96 /* UIViewControllerExtensionTests.swift */; };
1115
E10178021F3F753400F0BC97 /* UIViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E10178011F3F753400F0BC97 /* UIViewExtensions.swift */; };
1216
E107B08B1EB66CE6004C5E91 /* verbs.xml in Resources */ = {isa = PBXBuildFile; fileRef = E107B08A1EB66CE6004C5E91 /* verbs.xml */; };
1317
E107B0921EB66F28004C5E91 /* VerbParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = E107B0911EB66F28004C5E91 /* VerbParser.swift */; };
@@ -143,6 +147,10 @@
143147

144148
/* Begin PBXFileReference section */
145149
035C646E22299A7E001ECC02 /* RatingsFetcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RatingsFetcher.swift; sourceTree = "<group>"; };
150+
038E03122270A868005CFC96 /* IntExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntExtensionTests.swift; sourceTree = "<group>"; };
151+
038E03142270A9FB005CFC96 /* TestGameCenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestGameCenterTests.swift; sourceTree = "<group>"; };
152+
038E03172270AC01005CFC96 /* DeviceUtilityTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceUtilityTests.swift; sourceTree = "<group>"; };
153+
038E031922711B76005CFC96 /* UIViewControllerExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerExtensionTests.swift; sourceTree = "<group>"; };
146154
E10178011F3F753400F0BC97 /* UIViewExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewExtensions.swift; sourceTree = "<group>"; };
147155
E107B08A1EB66CE6004C5E91 /* verbs.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = verbs.xml; sourceTree = "<group>"; };
148156
E107B0911EB66F28004C5E91 /* VerbParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VerbParser.swift; sourceTree = "<group>"; };
@@ -275,6 +283,14 @@
275283
/* End PBXFrameworksBuildPhase section */
276284

277285
/* Begin PBXGroup section */
286+
038E03162270ABEA005CFC96 /* Analytics */ = {
287+
isa = PBXGroup;
288+
children = (
289+
038E03172270AC01005CFC96 /* DeviceUtilityTests.swift */,
290+
);
291+
path = Analytics;
292+
sourceTree = "<group>";
293+
};
278294
E107B08C1EB66E16004C5E91 /* Views */ = {
279295
isa = PBXGroup;
280296
children = (
@@ -390,6 +406,9 @@
390406
isa = PBXGroup;
391407
children = (
392408
E151223021A62AE9008EF307 /* ReviewPrompterTests.swift */,
409+
038E03122270A868005CFC96 /* IntExtensionTests.swift */,
410+
038E03142270A9FB005CFC96 /* TestGameCenterTests.swift */,
411+
038E031922711B76005CFC96 /* UIViewControllerExtensionTests.swift */,
393412
);
394413
path = Utils;
395414
sourceTree = "<group>";
@@ -490,6 +509,7 @@
490509
E1F06AEB1E8F05F400ADD2E1 /* ConjugarTests */ = {
491510
isa = PBXGroup;
492511
children = (
512+
038E03162270ABEA005CFC96 /* Analytics */,
493513
E15D3BED1F532E8E003771BB /* Controllers */,
494514
E15D3BF41F53397A003771BB /* Helpers */,
495515
E198F9031F5D7C6B00BAF553 /* Models */,
@@ -806,7 +826,10 @@
806826
isa = PBXSourcesBuildPhase;
807827
buildActionMask = 2147483647;
808828
files = (
829+
038E03182270AC01005CFC96 /* DeviceUtilityTests.swift in Sources */,
809830
E12D06A31F5E85A200CDD54E /* VerbCellTests.swift in Sources */,
831+
038E031A22711B76005CFC96 /* UIViewControllerExtensionTests.swift in Sources */,
832+
038E03132270A868005CFC96 /* IntExtensionTests.swift in Sources */,
810833
E151223121A62AE9008EF307 /* ReviewPrompterTests.swift in Sources */,
811834
E1DC939521B5836400DD4048 /* QuizTests.swift in Sources */,
812835
E198F9051F5D7CB200BAF553 /* ConjugatorTests.swift in Sources */,
@@ -815,6 +838,7 @@
815838
E14589F61F5B7E9D00EEF141 /* VerbVCTests.swift in Sources */,
816839
E15D3BF61F533997003771BB /* MockNavigationC.swift in Sources */,
817840
E198F9021F5D79F100BAF553 /* VerbViewTests.swift in Sources */,
841+
038E03152270A9FB005CFC96 /* TestGameCenterTests.swift in Sources */,
818842
E1F06AED1E8F05F400ADD2E1 /* MainTabBarVCTests.swift in Sources */,
819843
E15D3BF11F532F4E003771BB /* BrowseVerbsVCTests.swift in Sources */,
820844
);

Conjugar/BrowseInfoVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BrowseInfoVC: UIViewController, UITableViewDelegate, UITableViewDataSource
3333
if let castedView = view as? BrowseInfoView {
3434
return castedView
3535
} else {
36-
fatalError(fatalCastMessage(viewController: BrowseInfoVC.self, view: BrowseInfoView.self))
36+
fatalError(fatalCastMessage(view: BrowseInfoView.self))
3737
}
3838
}
3939

Conjugar/BrowseVerbsVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BrowseVerbsVC: UIViewController, UITableViewDelegate, UITableViewDataSourc
3333
if let castedView = view as? BrowseVerbsView {
3434
return castedView
3535
} else {
36-
fatalError(fatalCastMessage(viewController: BrowseVerbsVC.self, view: BrowseVerbsView.self))
36+
fatalError(fatalCastMessage(view: BrowseVerbsView.self))
3737
}
3838
}
3939

Conjugar/DeviceUtility.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public extension UIDevice {
6060
case "AppleTV6,2": return "Apple TV 4K"
6161
case "AudioAccessory1,1": return "HomePod"
6262
case "i386", "x86_64": return "Simulator"
63-
//case "i386", "x86_64": return "iPhone SE"
6463
default: return identifier
6564
}
6665
}

Conjugar/InfoVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class InfoVC: UIViewController, UITextViewDelegate {
1717
if let castedView = view as? InfoView {
1818
return castedView
1919
} else {
20-
fatalError(fatalCastMessage(viewController: InfoVC.self, view: InfoView.self))
20+
fatalError(fatalCastMessage(view: InfoView.self))
2121
}
2222
}
2323

Conjugar/QuizVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class QuizVC: UIViewController, UITextFieldDelegate, QuizDelegate {
1818
if let castedView = view as? QuizView {
1919
return castedView
2020
} else {
21-
fatalError(fatalCastMessage(viewController: QuizVC.self, view: QuizView.self))
21+
fatalError(fatalCastMessage(view: QuizView.self))
2222
}
2323
}
2424

Conjugar/ResultsVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ResultsVC: UIViewController, UITableViewDelegate, UITableViewDataSource {
1616
if let castedView = view as? ResultsView {
1717
return castedView
1818
} else {
19-
fatalError(fatalCastMessage(viewController: ResultsVC.self, view: ResultsView.self))
19+
fatalError(fatalCastMessage(view: ResultsView.self))
2020
}
2121
}
2222

Conjugar/SettingsVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SettingsVC: UIViewController {
1717
if let castedView = view as? SettingsView {
1818
return castedView
1919
} else {
20-
fatalError(fatalCastMessage(viewController: SettingsVC.self, view: SettingsView.self))
20+
fatalError(fatalCastMessage(view: SettingsView.self))
2121
}
2222
}
2323

Conjugar/UIViewControllerExtension.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import UIKit
1010

1111
extension UIViewController {
12-
func fatalCastMessage(viewController: Any, view: Any) -> String {
13-
return "Could not cast \(viewController).view to \(view)."
12+
func fatalCastMessage(view: Any) -> String {
13+
return "Could not cast \(self).view to \(view)."
1414
}
1515
}

Conjugar/VerbVC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class VerbVC: UIViewController {
1818
if let castedView = view as? VerbView {
1919
return castedView
2020
} else {
21-
fatalError(fatalCastMessage(viewController: VerbVC.self, view: VerbView.self))
21+
fatalError(fatalCastMessage(view: VerbView.self))
2222
}
2323
}
2424

0 commit comments

Comments
 (0)