Adding basic test
This commit is contained in:
parent
f7c1a3dcc0
commit
ea7924c5ac
@ -43,7 +43,6 @@
|
|||||||
7A49F4C627D4061B00AEAAE0 /* AutoCat2UITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F4C527D4061B00AEAAE0 /* AutoCat2UITestsLaunchTests.swift */; };
|
7A49F4C627D4061B00AEAAE0 /* AutoCat2UITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F4C527D4061B00AEAAE0 /* AutoCat2UITestsLaunchTests.swift */; };
|
||||||
7A49F4DB27D4064500AEAAE0 /* AutoCatCore.docc in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F4DA27D4064500AEAAE0 /* AutoCatCore.docc */; };
|
7A49F4DB27D4064500AEAAE0 /* AutoCatCore.docc in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F4DA27D4064500AEAAE0 /* AutoCatCore.docc */; };
|
||||||
7A49F4E127D4064500AEAAE0 /* AutoCatCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A49F4D727D4064500AEAAE0 /* AutoCatCore.framework */; };
|
7A49F4E127D4064500AEAAE0 /* AutoCatCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A49F4D727D4064500AEAAE0 /* AutoCatCore.framework */; };
|
||||||
7A49F4E827D4064500AEAAE0 /* AutoCatCoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F4E727D4064500AEAAE0 /* AutoCatCoreTests.swift */; };
|
|
||||||
7A49F4E927D4064500AEAAE0 /* AutoCatCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A49F4D927D4064500AEAAE0 /* AutoCatCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
7A49F4E927D4064500AEAAE0 /* AutoCatCore.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A49F4D927D4064500AEAAE0 /* AutoCatCore.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||||
7A49F4EC27D4064500AEAAE0 /* AutoCatCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A49F4D727D4064500AEAAE0 /* AutoCatCore.framework */; };
|
7A49F4EC27D4064500AEAAE0 /* AutoCatCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A49F4D727D4064500AEAAE0 /* AutoCatCore.framework */; };
|
||||||
7A49F4ED27D4064500AEAAE0 /* AutoCatCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7A49F4D727D4064500AEAAE0 /* AutoCatCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
7A49F4ED27D4064500AEAAE0 /* AutoCatCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7A49F4D727D4064500AEAAE0 /* AutoCatCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
@ -61,6 +60,13 @@
|
|||||||
7A49F51127D406CB00AEAAE0 /* PlateNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */; };
|
7A49F51127D406CB00AEAAE0 /* PlateNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */; };
|
||||||
7A49F51227D406CB00AEAAE0 /* VName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F50B27D406CB00AEAAE0 /* VName.swift */; };
|
7A49F51227D406CB00AEAAE0 /* VName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F50B27D406CB00AEAAE0 /* VName.swift */; };
|
||||||
7A49F51527D40C6100AEAAE0 /* AutoCat2.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F51327D40C6100AEAAE0 /* AutoCat2.xcdatamodeld */; };
|
7A49F51527D40C6100AEAAE0 /* AutoCat2.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 7A49F51327D40C6100AEAAE0 /* AutoCat2.xcdatamodeld */; };
|
||||||
|
7A558AB027FA3CCF001A18EE /* SettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A558AA527FA3CCF001A18EE /* SettingsTests.swift */; };
|
||||||
|
7A558AB127FA3CCF001A18EE /* ApiTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A558AA627FA3CCF001A18EE /* ApiTests.swift */; };
|
||||||
|
7A558AB227FA3CCF001A18EE /* LoginMethodMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A558AA927FA3CCF001A18EE /* LoginMethodMock.swift */; };
|
||||||
|
7A558AB327FA3CCF001A18EE /* ApiMethodMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A558AAA27FA3CCF001A18EE /* ApiMethodMock.swift */; };
|
||||||
|
7A558AB427FA3CCF001A18EE /* login_success.json in Resources */ = {isa = PBXBuildFile; fileRef = 7A558AAC27FA3CCF001A18EE /* login_success.json */; };
|
||||||
|
7A558AB527FA3CCF001A18EE /* MockURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A558AAE27FA3CCF001A18EE /* MockURLProtocol.swift */; };
|
||||||
|
7A558AB627FA3CCF001A18EE /* ApiMethodMockProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A558AAF27FA3CCF001A18EE /* ApiMethodMockProtocol.swift */; };
|
||||||
7A9F2AC327E71531006492A9 /* ACTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A9F2AC227E71531006492A9 /* ACTabBarController.swift */; };
|
7A9F2AC327E71531006492A9 /* ACTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A9F2AC227E71531006492A9 /* ACTabBarController.swift */; };
|
||||||
7AE32D6427F05F89004EF6E0 /* VehicleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6327F05F89004EF6E0 /* VehicleCell.swift */; };
|
7AE32D6427F05F89004EF6E0 /* VehicleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6327F05F89004EF6E0 /* VehicleCell.swift */; };
|
||||||
7AE32D6627F063A1004EF6E0 /* UIEdgeInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */; };
|
7AE32D6627F063A1004EF6E0 /* UIEdgeInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */; };
|
||||||
@ -169,7 +175,6 @@
|
|||||||
7A49F4D927D4064500AEAAE0 /* AutoCatCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutoCatCore.h; sourceTree = "<group>"; };
|
7A49F4D927D4064500AEAAE0 /* AutoCatCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AutoCatCore.h; sourceTree = "<group>"; };
|
||||||
7A49F4DA27D4064500AEAAE0 /* AutoCatCore.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = AutoCatCore.docc; sourceTree = "<group>"; };
|
7A49F4DA27D4064500AEAAE0 /* AutoCatCore.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = AutoCatCore.docc; sourceTree = "<group>"; };
|
||||||
7A49F4E027D4064500AEAAE0 /* AutoCatCoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AutoCatCoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
7A49F4E027D4064500AEAAE0 /* AutoCatCoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AutoCatCoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
7A49F4E727D4064500AEAAE0 /* AutoCatCoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoCatCoreTests.swift; sourceTree = "<group>"; };
|
|
||||||
7A49F4F627D406B200AEAAE0 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
|
7A49F4F627D406B200AEAAE0 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
|
||||||
7A49F4F727D406B200AEAAE0 /* ApiError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiError.swift; sourceTree = "<group>"; };
|
7A49F4F727D406B200AEAAE0 /* ApiError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiError.swift; sourceTree = "<group>"; };
|
||||||
7A49F4F827D406B200AEAAE0 /* Api.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Api.swift; sourceTree = "<group>"; };
|
7A49F4F827D406B200AEAAE0 /* Api.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Api.swift; sourceTree = "<group>"; };
|
||||||
@ -184,6 +189,13 @@
|
|||||||
7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlateNumber.swift; sourceTree = "<group>"; };
|
7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlateNumber.swift; sourceTree = "<group>"; };
|
||||||
7A49F50B27D406CB00AEAAE0 /* VName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VName.swift; sourceTree = "<group>"; };
|
7A49F50B27D406CB00AEAAE0 /* VName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VName.swift; sourceTree = "<group>"; };
|
||||||
7A49F51427D40C6100AEAAE0 /* Shared.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Shared.xcdatamodel; sourceTree = "<group>"; };
|
7A49F51427D40C6100AEAAE0 /* Shared.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Shared.xcdatamodel; sourceTree = "<group>"; };
|
||||||
|
7A558AA527FA3CCF001A18EE /* SettingsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTests.swift; sourceTree = "<group>"; };
|
||||||
|
7A558AA627FA3CCF001A18EE /* ApiTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiTests.swift; sourceTree = "<group>"; };
|
||||||
|
7A558AA927FA3CCF001A18EE /* LoginMethodMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginMethodMock.swift; sourceTree = "<group>"; };
|
||||||
|
7A558AAA27FA3CCF001A18EE /* ApiMethodMock.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiMethodMock.swift; sourceTree = "<group>"; };
|
||||||
|
7A558AAC27FA3CCF001A18EE /* login_success.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = login_success.json; sourceTree = "<group>"; };
|
||||||
|
7A558AAE27FA3CCF001A18EE /* MockURLProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockURLProtocol.swift; sourceTree = "<group>"; };
|
||||||
|
7A558AAF27FA3CCF001A18EE /* ApiMethodMockProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiMethodMockProtocol.swift; sourceTree = "<group>"; };
|
||||||
7A9F2AC227E71531006492A9 /* ACTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ACTabBarController.swift; sourceTree = "<group>"; };
|
7A9F2AC227E71531006492A9 /* ACTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ACTabBarController.swift; sourceTree = "<group>"; };
|
||||||
7AE32D6327F05F89004EF6E0 /* VehicleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleCell.swift; sourceTree = "<group>"; };
|
7AE32D6327F05F89004EF6E0 /* VehicleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleCell.swift; sourceTree = "<group>"; };
|
||||||
7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = "<group>"; };
|
7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = "<group>"; };
|
||||||
@ -399,7 +411,9 @@
|
|||||||
7A49F4E627D4064500AEAAE0 /* AutoCatCoreTests */ = {
|
7A49F4E627D4064500AEAAE0 /* AutoCatCoreTests */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
7A49F4E727D4064500AEAAE0 /* AutoCatCoreTests.swift */,
|
7A558AA727FA3CCF001A18EE /* Api */,
|
||||||
|
7A558AA627FA3CCF001A18EE /* ApiTests.swift */,
|
||||||
|
7A558AA527FA3CCF001A18EE /* SettingsTests.swift */,
|
||||||
);
|
);
|
||||||
path = AutoCatCoreTests;
|
path = AutoCatCoreTests;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -444,6 +458,42 @@
|
|||||||
path = Models;
|
path = Models;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
7A558AA727FA3CCF001A18EE /* Api */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
7A558AA827FA3CCF001A18EE /* Mocks */,
|
||||||
|
7A558AAB27FA3CCF001A18EE /* Responses */,
|
||||||
|
7A558AAD27FA3CCF001A18EE /* Lib */,
|
||||||
|
);
|
||||||
|
path = Api;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
7A558AA827FA3CCF001A18EE /* Mocks */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
7A558AA927FA3CCF001A18EE /* LoginMethodMock.swift */,
|
||||||
|
7A558AAA27FA3CCF001A18EE /* ApiMethodMock.swift */,
|
||||||
|
);
|
||||||
|
path = Mocks;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
7A558AAB27FA3CCF001A18EE /* Responses */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
7A558AAC27FA3CCF001A18EE /* login_success.json */,
|
||||||
|
);
|
||||||
|
path = Responses;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
7A558AAD27FA3CCF001A18EE /* Lib */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
7A558AAE27FA3CCF001A18EE /* MockURLProtocol.swift */,
|
||||||
|
7A558AAF27FA3CCF001A18EE /* ApiMethodMockProtocol.swift */,
|
||||||
|
);
|
||||||
|
path = Lib;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
7AE32D6227F05F5D004EF6E0 /* Cells */ = {
|
7AE32D6227F05F5D004EF6E0 /* Cells */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@ -699,6 +749,7 @@
|
|||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
7A558AB427FA3CCF001A18EE /* login_success.json in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -791,7 +842,12 @@
|
|||||||
isa = PBXSourcesBuildPhase;
|
isa = PBXSourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
7A49F4E827D4064500AEAAE0 /* AutoCatCoreTests.swift in Sources */,
|
7A558AB227FA3CCF001A18EE /* LoginMethodMock.swift in Sources */,
|
||||||
|
7A558AB027FA3CCF001A18EE /* SettingsTests.swift in Sources */,
|
||||||
|
7A558AB127FA3CCF001A18EE /* ApiTests.swift in Sources */,
|
||||||
|
7A558AB627FA3CCF001A18EE /* ApiMethodMockProtocol.swift in Sources */,
|
||||||
|
7A558AB527FA3CCF001A18EE /* MockURLProtocol.swift in Sources */,
|
||||||
|
7A558AB327FA3CCF001A18EE /* ApiMethodMock.swift in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,43 +1,41 @@
|
|||||||
{
|
{
|
||||||
"object": {
|
"pins" : [
|
||||||
"pins": [
|
|
||||||
{
|
{
|
||||||
"package": "DifferenceKit",
|
"identity" : "differencekit",
|
||||||
"repositoryURL": "https://github.com/ra1028/DifferenceKit",
|
"kind" : "remoteSourceControl",
|
||||||
"state": {
|
"location" : "https://github.com/ra1028/DifferenceKit",
|
||||||
"branch": null,
|
"state" : {
|
||||||
"revision": "62745d7780deef4a023a792a1f8f763ec7bf9705",
|
"revision" : "62745d7780deef4a023a792a1f8f763ec7bf9705",
|
||||||
"version": "1.2.0"
|
"version" : "1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"package": "PKHUD",
|
"identity" : "pkhud",
|
||||||
"repositoryURL": "https://github.com/pkluz/PKHUD.git",
|
"kind" : "remoteSourceControl",
|
||||||
"state": {
|
"location" : "https://github.com/pkluz/PKHUD.git",
|
||||||
"branch": null,
|
"state" : {
|
||||||
"revision": "8fd26f23057c6bebd6695524b1c3e05e93aba571",
|
"revision" : "8fd26f23057c6bebd6695524b1c3e05e93aba571",
|
||||||
"version": "5.4.0"
|
"version" : "5.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"package": "SwiftDate",
|
"identity" : "swiftdate",
|
||||||
"repositoryURL": "https://github.com/malcommac/SwiftDate",
|
"kind" : "remoteSourceControl",
|
||||||
"state": {
|
"location" : "https://github.com/malcommac/SwiftDate",
|
||||||
"branch": null,
|
"state" : {
|
||||||
"revision": "6190d0cefff3013e77ed567e6b074f324e5c5bf5",
|
"revision" : "6190d0cefff3013e77ed567e6b074f324e5c5bf5",
|
||||||
"version": "6.3.1"
|
"version" : "6.3.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"package": "SwiftEntryKit",
|
"identity" : "swiftentrykit",
|
||||||
"repositoryURL": "https://github.com/huri000/SwiftEntryKit",
|
"kind" : "remoteSourceControl",
|
||||||
"state": {
|
"location" : "https://github.com/huri000/SwiftEntryKit",
|
||||||
"branch": null,
|
"state" : {
|
||||||
"revision": "5ad36cccf0c4b9fea32f4e9b17a8e38f07563ef0",
|
"revision" : "5ad36cccf0c4b9fea32f4e9b17a8e38f07563ef0",
|
||||||
"version": "2.0.0"
|
"version" : "2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
},
|
"version" : 2
|
||||||
"version": 1
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,33 +12,33 @@
|
|||||||
<key>AutoCat2.xcscheme_^#shared#^_</key>
|
<key>AutoCat2.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>0</integer>
|
<integer>1</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>AutoCatCore.xcscheme_^#shared#^_</key>
|
<key>AutoCatCore.xcscheme_^#shared#^_</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>2</integer>
|
<integer>0</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>DifferenceKit (Playground) 1.xcscheme</key>
|
<key>DifferenceKit (Playground) 1.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>6</integer>
|
<integer>3</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>DifferenceKit (Playground) 2.xcscheme</key>
|
<key>DifferenceKit (Playground) 2.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>7</integer>
|
<integer>4</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>DifferenceKit (Playground).xcscheme</key>
|
<key>DifferenceKit (Playground).xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>isShown</key>
|
<key>isShown</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>1</integer>
|
<integer>2</integer>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SwiftDate (Playground) 1.xcscheme</key>
|
<key>SwiftDate (Playground) 1.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
@ -62,5 +62,13 @@
|
|||||||
<integer>3</integer>
|
<integer>3</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
<dict>
|
||||||
|
<key>7A49F4D627D4064500AEAAE0</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -21,12 +21,12 @@ public struct Vehicle: Decodable {
|
|||||||
public let isJapanese: Bool?
|
public let isJapanese: Bool?
|
||||||
public let addedBy: String?
|
public let addedBy: String?
|
||||||
public let engine: VEngine?
|
public let engine: VEngine?
|
||||||
public let photos: [VPhoto]
|
public let photos: [VPhoto]?
|
||||||
public let ownershipPeriods: [VOwnershipPeriod]
|
public let ownershipPeriods: [VOwnershipPeriod]?
|
||||||
public let events: [VEvent]
|
public let events: [VEvent]?
|
||||||
public let osagoContracts: [VOsago]
|
public let osagoContracts: [VOsago]?
|
||||||
public let ads: [VAd]
|
public let ads: [VAd]?
|
||||||
public let notes: [VNote]
|
public let notes: [VNote]?
|
||||||
public let debugInfo: DebugInfo?
|
public let debugInfo: DebugInfo?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,12 +75,25 @@ extension CDVehicle {
|
|||||||
self.addedBy = vehicle.addedBy
|
self.addedBy = vehicle.addedBy
|
||||||
self.synchronized = true
|
self.synchronized = true
|
||||||
self.engine = CDVEngine(model: vehicle.engine, context: context)
|
self.engine = CDVEngine(model: vehicle.engine, context: context)
|
||||||
self.photos = NSSet(array: vehicle.photos.map { CDVPhoto(model: $0, context: context) })
|
|
||||||
self.ownershipPeriods = NSSet(array: vehicle.ownershipPeriods.map { CDVOwnershipPeriod(model: $0, context: context) })
|
let photos = vehicle.photos?.map { CDVPhoto(model: $0, context: context) } ?? []
|
||||||
self.events = NSSet(array: vehicle.events.map { CDVEvent(model: $0, context: context) })
|
self.photos = NSSet(array: photos)
|
||||||
self.osagoContracts = NSSet(array: vehicle.osagoContracts.map { CDVOsago(model: $0, context: context) })
|
|
||||||
self.ads = NSSet(array: vehicle.ads.map { CDVAd(model: $0, context: context) })
|
let ownershipPeriods = vehicle.ownershipPeriods?.map { CDVOwnershipPeriod(model: $0, context: context) } ?? []
|
||||||
self.notes = NSSet(array: vehicle.notes.map { CDVNote(model: $0, context: context) })
|
self.ownershipPeriods = NSSet(array: ownershipPeriods)
|
||||||
|
|
||||||
|
let events = vehicle.events?.map { CDVEvent(model: $0, context: context) } ?? []
|
||||||
|
self.events = NSSet(array: events)
|
||||||
|
|
||||||
|
let osagoContracts = vehicle.osagoContracts?.map { CDVOsago(model: $0, context: context) } ?? []
|
||||||
|
self.osagoContracts = NSSet(array: osagoContracts)
|
||||||
|
|
||||||
|
let ads = vehicle.ads?.map { CDVAd(model: $0, context: context) } ?? []
|
||||||
|
self.ads = NSSet(array: ads)
|
||||||
|
|
||||||
|
let notes = vehicle.notes?.map { CDVNote(model: $0, context: context) } ?? []
|
||||||
|
self.notes = NSSet(array: notes)
|
||||||
|
|
||||||
self.debugInfo = CDDebugInfo(model: vehicle.debugInfo, context: context)
|
self.debugInfo = CDDebugInfo(model: vehicle.debugInfo, context: context)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -74,14 +74,14 @@ public class Api: ApiProtocol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// let str = String(data: data, encoding: .utf8)
|
// let str = String(data: data, encoding: .utf8)
|
||||||
// print("================================")
|
// print("================================")
|
||||||
// if let string = str?.replacingOccurrences(of: "\\\"", with: "\"")
|
// if let string = str?.replacingOccurrences(of: "\\\"", with: "\"")
|
||||||
// .replacingOccurrences(of: "\\'", with: "'")
|
// .replacingOccurrences(of: "\\'", with: "'")
|
||||||
// .replacingOccurrences(of: "\\n", with: "") {
|
// .replacingOccurrences(of: "\\n", with: "") {
|
||||||
// print(string)
|
// print(string)
|
||||||
// }
|
// }
|
||||||
// print("================================")
|
// print("================================")
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let resp = try JSONDecoder().decode(Response<T>.self, from: data)
|
let resp = try JSONDecoder().decode(Response<T>.self, from: data)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public enum ApiError: LocalizedError {
|
public enum ApiError: LocalizedError, Equatable {
|
||||||
|
|
||||||
case generic
|
case generic
|
||||||
case message(String)
|
case message(String)
|
||||||
@ -28,4 +28,13 @@ public enum ApiError: LocalizedError {
|
|||||||
self = .generic
|
self = .generic
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func code() -> Int? {
|
||||||
|
switch self {
|
||||||
|
case .invalidLoginOrPassword:
|
||||||
|
return 0
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
AutoCatCoreTests/Api/Lib/ApiMethodMockProtocol.swift
Normal file
7
AutoCatCoreTests/Api/Lib/ApiMethodMockProtocol.swift
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
protocol ApiMethodMockProtocol {
|
||||||
|
var path: String { get }
|
||||||
|
var httpMethod: String { get }
|
||||||
|
func response(headers: [String: String], params: [String: Any]) -> (status: Int, data: Data?)
|
||||||
|
}
|
||||||
96
AutoCatCoreTests/Api/Lib/MockURLProtocol.swift
Normal file
96
AutoCatCoreTests/Api/Lib/MockURLProtocol.swift
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
import Foundation
|
||||||
|
|
||||||
|
extension URL {
|
||||||
|
public var queryParameters: [String: String]? {
|
||||||
|
guard
|
||||||
|
let components = URLComponents(url: self, resolvingAgainstBaseURL: true),
|
||||||
|
let queryItems = components.queryItems else { return nil }
|
||||||
|
return queryItems.reduce(into: [String: String]()) { (result, item) in
|
||||||
|
result[item.name] = item.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension URLRequest {
|
||||||
|
func bodySteamAsJSON() -> [String: Any]? {
|
||||||
|
guard let bodyStream = self.httpBodyStream else { return nil }
|
||||||
|
|
||||||
|
bodyStream.open()
|
||||||
|
|
||||||
|
// Will read 16 chars per iteration. Can use bigger buffer if needed
|
||||||
|
let bufferSize: Int = 16
|
||||||
|
let buffer = UnsafeMutablePointer<UInt8>.allocate(capacity: bufferSize)
|
||||||
|
var dat = Data()
|
||||||
|
|
||||||
|
while bodyStream.hasBytesAvailable {
|
||||||
|
let readDat = bodyStream.read(buffer, maxLength: bufferSize)
|
||||||
|
dat.append(buffer, count: readDat)
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer.deallocate()
|
||||||
|
bodyStream.close()
|
||||||
|
|
||||||
|
return try? JSONSerialization.jsonObject(with: dat, options: JSONSerialization.ReadingOptions.allowFragments) as? [String: Any]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MockURLProtocol: URLProtocol {
|
||||||
|
|
||||||
|
static var baseUrl: String = ""
|
||||||
|
static var apiMethodMocks: [ApiMethodMockProtocol] = []
|
||||||
|
|
||||||
|
override class func canInit(with request: URLRequest) -> Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override class func canonicalRequest(for request: URLRequest) -> URLRequest {
|
||||||
|
return request
|
||||||
|
}
|
||||||
|
|
||||||
|
override func startLoading() {
|
||||||
|
guard let requestUrl = request.url else { return }
|
||||||
|
|
||||||
|
let methodMock = MockURLProtocol.apiMethodMocks.first {
|
||||||
|
return request.url?.absoluteString == MockURLProtocol.baseUrl + $0.path
|
||||||
|
&& request.httpMethod == $0.httpMethod
|
||||||
|
}
|
||||||
|
|
||||||
|
guard let methodMock = methodMock else {
|
||||||
|
if let response = HTTPURLResponse(url: requestUrl, statusCode: 404, httpVersion: "HTTP/2", headerFields: [:]) {
|
||||||
|
client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed)
|
||||||
|
client?.urlProtocolDidFinishLoading(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assuming we use url parameters in GET requests and JSON-encoded body in everything else
|
||||||
|
var params: [String: Any] = [:]
|
||||||
|
if request.httpBodyStream != nil {
|
||||||
|
if let bodyDict = request.bodySteamAsJSON() {
|
||||||
|
params = bodyDict
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if let urlParams = requestUrl.queryParameters {
|
||||||
|
params = urlParams
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let result = methodMock.response(headers: request.allHTTPHeaderFields ?? [:], params: params)
|
||||||
|
guard let response = HTTPURLResponse(url: requestUrl, statusCode: result.status, httpVersion: "HTTP/2", headerFields: [:]) else { return }
|
||||||
|
|
||||||
|
client?.urlProtocol(self, didReceive: response, cacheStoragePolicy: .notAllowed)
|
||||||
|
|
||||||
|
if let data = result.data {
|
||||||
|
client?.urlProtocol(self, didLoad: data)
|
||||||
|
}
|
||||||
|
|
||||||
|
client?.urlProtocolDidFinishLoading(self)
|
||||||
|
|
||||||
|
//client?.urlProtocol(self, didFailWithError: error)
|
||||||
|
}
|
||||||
|
|
||||||
|
override func stopLoading() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
39
AutoCatCoreTests/Api/Mocks/ApiMethodMock.swift
Normal file
39
AutoCatCoreTests/Api/Mocks/ApiMethodMock.swift
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import Foundation
|
||||||
|
import AutoCatCore
|
||||||
|
|
||||||
|
open class ApiMethodMock: ApiMethodMockProtocol {
|
||||||
|
|
||||||
|
private(set) var path: String
|
||||||
|
private(set) var httpMethod: String
|
||||||
|
|
||||||
|
init(httpMethod: String, path: String) {
|
||||||
|
self.httpMethod = httpMethod
|
||||||
|
self.path = path
|
||||||
|
}
|
||||||
|
|
||||||
|
func readData(from path: String) -> Data? {
|
||||||
|
guard let url = Bundle(for: type(of: self)).url(forResource: path, withExtension: "json") else { return nil }
|
||||||
|
return try? Data(contentsOf: url)
|
||||||
|
}
|
||||||
|
|
||||||
|
func error(message: String, code: Int? = nil) -> Data? {
|
||||||
|
var errorData: [String: AnyEncodable] = [
|
||||||
|
"success": false,
|
||||||
|
"error": AnyEncodable(message)
|
||||||
|
]
|
||||||
|
|
||||||
|
if let code = code {
|
||||||
|
errorData["errorCode"] = AnyEncodable(code)
|
||||||
|
}
|
||||||
|
|
||||||
|
return try? JSONEncoder().encode(errorData)
|
||||||
|
}
|
||||||
|
|
||||||
|
func notFoundResponse() -> (status: Int, data: Data?) {
|
||||||
|
return (status: 404, data: self.error(message: "Not found"))
|
||||||
|
}
|
||||||
|
|
||||||
|
open func response(headers: [String : String], params: [String : Any]) -> (status: Int, data: Data?) {
|
||||||
|
return self.notFoundResponse()
|
||||||
|
}
|
||||||
|
}
|
||||||
25
AutoCatCoreTests/Api/Mocks/LoginMethodMock.swift
Normal file
25
AutoCatCoreTests/Api/Mocks/LoginMethodMock.swift
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import Foundation
|
||||||
|
import AutoCatCore
|
||||||
|
|
||||||
|
class LoginMethodMock: ApiMethodMock {
|
||||||
|
private var login: String
|
||||||
|
private var password: String
|
||||||
|
|
||||||
|
init(httpMethod: String, path: String, login: String, password: String) {
|
||||||
|
self.login = login
|
||||||
|
self.password = password
|
||||||
|
super.init(httpMethod: httpMethod, path: path)
|
||||||
|
}
|
||||||
|
|
||||||
|
override func response(headers: [String : String], params: [String : Any]) -> (status: Int, data: Data?) {
|
||||||
|
guard let login = params["email"] as? String, let password = params["password"] as? String else {
|
||||||
|
return (status: 400, data: self.error(message: "Invalid parameters"))
|
||||||
|
}
|
||||||
|
|
||||||
|
if login != self.login || password != self.password {
|
||||||
|
return (status: 200, data: self.error(message: "Incorrect login or password", code: ApiError.invalidLoginOrPassword.code()))
|
||||||
|
}
|
||||||
|
|
||||||
|
return (status: 200, data: readData(from: "login_success"))
|
||||||
|
}
|
||||||
|
}
|
||||||
8
AutoCatCoreTests/Api/Responses/login_success.json
Normal file
8
AutoCatCoreTests/Api/Responses/login_success.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"data": {
|
||||||
|
"_id": "832c1bd4-5caa-4c9d-b24c-4c000cd8a793",
|
||||||
|
"email": "selim@fastmail.fm",
|
||||||
|
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InNlbGltQGZhc3RtYWlsLmZtIiwiaWF0IjoxNjI2MjgwNDgxLCJleHAiOjE2NTc4MTY0ODF9.eU6wpacgCSnhM4EiyMY2lUptsfSfHz9guuvOsAw4X90"
|
||||||
|
}
|
||||||
|
}
|
||||||
45
AutoCatCoreTests/ApiTests.swift
Normal file
45
AutoCatCoreTests/ApiTests.swift
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import XCTest
|
||||||
|
import AutoCatCore
|
||||||
|
|
||||||
|
class ApiTests: XCTestCase {
|
||||||
|
|
||||||
|
private var api: ApiProtocol!
|
||||||
|
|
||||||
|
private let testLogin = "test@gmail.com"
|
||||||
|
private let testPassword = "12345"
|
||||||
|
|
||||||
|
override func setUpWithError() throws {
|
||||||
|
MockURLProtocol.baseUrl = Constants.baseUrl
|
||||||
|
MockURLProtocol.apiMethodMocks = [
|
||||||
|
LoginMethodMock(httpMethod: "POST", path: "user/login", login: self.testLogin, password: self.testPassword)
|
||||||
|
]
|
||||||
|
|
||||||
|
let sessionConfig = URLSessionConfiguration.default
|
||||||
|
sessionConfig.protocolClasses = [MockURLProtocol.self]
|
||||||
|
let session = URLSession(configuration: sessionConfig)
|
||||||
|
self.api = Api(session: session)
|
||||||
|
}
|
||||||
|
|
||||||
|
override func tearDownWithError() throws {
|
||||||
|
MockURLProtocol.baseUrl = ""
|
||||||
|
MockURLProtocol.apiMethodMocks = []
|
||||||
|
}
|
||||||
|
|
||||||
|
func testLoginSuccess() async throws {
|
||||||
|
let user = try await self.api.login(email: self.testLogin, password: self.testPassword)
|
||||||
|
XCTAssertTrue(!user.token.isEmpty)
|
||||||
|
}
|
||||||
|
|
||||||
|
func testLoginInvalidParams() async throws {
|
||||||
|
do {
|
||||||
|
_ = try await self.api.login(email: "", password: "")
|
||||||
|
} catch let error as ApiError {
|
||||||
|
XCTAssertTrue(error == .invalidLoginOrPassword)
|
||||||
|
return
|
||||||
|
} catch {
|
||||||
|
XCTFail("Wrong exception type")
|
||||||
|
}
|
||||||
|
|
||||||
|
XCTFail("Exception expected")
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,36 +0,0 @@
|
|||||||
//
|
|
||||||
// AutoCatCoreTests.swift
|
|
||||||
// AutoCatCoreTests
|
|
||||||
//
|
|
||||||
// Created by Selim Mustafaev on 05.03.2022.
|
|
||||||
//
|
|
||||||
|
|
||||||
import XCTest
|
|
||||||
@testable import AutoCatCore
|
|
||||||
|
|
||||||
class AutoCatCoreTests: XCTestCase {
|
|
||||||
|
|
||||||
override func setUpWithError() throws {
|
|
||||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
override func tearDownWithError() throws {
|
|
||||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
|
||||||
}
|
|
||||||
|
|
||||||
func testExample() throws {
|
|
||||||
// This is an example of a functional test case.
|
|
||||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
|
||||||
// Any test you write for XCTest can be annotated as throws and async.
|
|
||||||
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
|
|
||||||
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
|
|
||||||
}
|
|
||||||
|
|
||||||
func testPerformanceExample() throws {
|
|
||||||
// This is an example of a performance test case.
|
|
||||||
self.measure {
|
|
||||||
// Put the code you want to measure the time of here.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
79
AutoCatCoreTests/SettingsTests.swift
Normal file
79
AutoCatCoreTests/SettingsTests.swift
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
import XCTest
|
||||||
|
import AutoCatCore
|
||||||
|
|
||||||
|
enum TestError: LocalizedError {
|
||||||
|
|
||||||
|
case createDefaultsFailed
|
||||||
|
|
||||||
|
public var errorDescription: String? {
|
||||||
|
switch self {
|
||||||
|
case .createDefaultsFailed:
|
||||||
|
return "Failed to create UserDefaults"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SettingsTests: XCTestCase {
|
||||||
|
|
||||||
|
private var settings: SettingsProtocol!
|
||||||
|
|
||||||
|
override func setUpWithError() throws {
|
||||||
|
guard let userDefaults = UserDefaults(suiteName: #file) else {
|
||||||
|
throw TestError.createDefaultsFailed
|
||||||
|
}
|
||||||
|
userDefaults.removePersistentDomain(forName: #file)
|
||||||
|
self.settings = Settings(defaults: userDefaults)
|
||||||
|
}
|
||||||
|
|
||||||
|
override func tearDownWithError() throws {
|
||||||
|
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||||
|
}
|
||||||
|
|
||||||
|
func testAlternativeOrder() {
|
||||||
|
XCTAssert(self.settings.recognizeAlternativeOrder == false, "recognizeAlternativeOrder: wrong default value")
|
||||||
|
self.settings.recognizeAlternativeOrder = true
|
||||||
|
XCTAssert(self.settings.recognizeAlternativeOrder == true, "recognizeAlternativeOrder: failed to change value")
|
||||||
|
}
|
||||||
|
|
||||||
|
func testShortenedNumbers() {
|
||||||
|
XCTAssert(self.settings.recognizeShortenedNumbers == false, "recognizeShortenedNumbers: wrong default value")
|
||||||
|
self.settings.recognizeShortenedNumbers = true
|
||||||
|
XCTAssert(self.settings.recognizeShortenedNumbers == true, "recognizeShortenedNumbers: failed to change value")
|
||||||
|
}
|
||||||
|
|
||||||
|
func testDefaultRegion() {
|
||||||
|
XCTAssert(self.settings.defaultRegion == "161", "defaultRegion: wrong default value")
|
||||||
|
self.settings.defaultRegion = "761"
|
||||||
|
XCTAssert(self.settings.defaultRegion == "761", "defaultRegion: failed to change value")
|
||||||
|
}
|
||||||
|
|
||||||
|
func testRecordBeep() {
|
||||||
|
XCTAssert(self.settings.recordBeep == false, "recordBeep: wrong default value")
|
||||||
|
self.settings.recordBeep = true
|
||||||
|
XCTAssert(self.settings.recordBeep == true, "recordBeep: failed to change value")
|
||||||
|
}
|
||||||
|
|
||||||
|
func testDebugInfo() {
|
||||||
|
XCTAssert(self.settings.showDebugInfo == false, "showDebugInfo: wrong default value")
|
||||||
|
self.settings.showDebugInfo = true
|
||||||
|
XCTAssert(self.settings.showDebugInfo == true, "showDebugInfo: failed to change value")
|
||||||
|
}
|
||||||
|
|
||||||
|
func testDefaultUser() {
|
||||||
|
XCTAssert(self.settings.user.email.isEmpty, "Default user email is not empty")
|
||||||
|
XCTAssert(self.settings.user.token.isEmpty, "Default user token is not empty")
|
||||||
|
XCTAssert(self.settings.user.firebaseIdToken == nil, "Default user firebase ID token is not nil")
|
||||||
|
XCTAssert(self.settings.user.firebaseRefreshToken == nil, "Default user firebase refresh token is not nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
func testSaveUser() {
|
||||||
|
self.settings.user.token = "TestToken"
|
||||||
|
XCTAssert(self.settings.user.token == "TestToken", "Failed to save user token to settings")
|
||||||
|
|
||||||
|
self.settings.user.firebaseIdToken = "TestFirebaseToken"
|
||||||
|
XCTAssert(self.settings.user.firebaseIdToken == "TestFirebaseToken", "Failed to save user firebaseIdToken to settings")
|
||||||
|
|
||||||
|
self.settings.user.firebaseRefreshToken = "TestResreshToken"
|
||||||
|
XCTAssert(self.settings.user.firebaseRefreshToken == "TestResreshToken", "Failed to save user firebaseRefreshToken to settings")
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user