Skip to content

Commit a7ae9a9

Browse files
authored
Доработал unit-тесты (#227)
* Доработал юнит-тесты - Покрыл тестами модели для создания/изменения профиля/мероприятия/площадки - Сделал тест-план для тестов Utils и SWModels - Доработал проверку при сохранении мероприятия - Обновил логику в `queryAllowedURL` (на iOS 17 URL умеет из коробки кодировать кириллицу) - Мелкий рефактор - Поднял версию приложения до 3.5.6 * Обновил .gitignore
1 parent 79b9ced commit a7ae9a9

File tree

19 files changed

+813
-181
lines changed

19 files changed

+813
-181
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ SwiftUI-WorkoutApp.xcodeproj/project.xcworkspace/xcuserdata/oleg991.xcuserdatad/
55
SwiftUI-WorkoutApp/.DS_Store
66
fastlane/report.xml
77
.DS_Store
8+
SwiftUI-WorkoutApp.xcodeproj/xcuserdata/oleg991.xcuserdatad/xcschemes/xcschememanagement.plist

SwiftUI-WorkoutApp.xcodeproj/project.pbxproj

Lines changed: 4 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@
8989
remoteGlobalIDString = 6798AA39280AEDC900DB76F1;
9090
remoteInfo = "SwiftUI-WorkoutApp";
9191
};
92-
675083AE297C0A60008D8C52 /* PBXContainerItemProxy */ = {
93-
isa = PBXContainerItemProxy;
94-
containerPortal = 6798AA32280AEDC900DB76F1 /* Project object */;
95-
proxyType = 1;
96-
remoteGlobalIDString = 6798AA39280AEDC900DB76F1;
97-
remoteInfo = "SwiftUI-WorkoutApp";
98-
};
9992
/* End PBXContainerItemProxy section */
10093

10194
/* Begin PBXFileReference section */
@@ -117,7 +110,6 @@
117110
674DF03D2B11254D00828016 /* Binding+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Binding+.swift"; sourceTree = "<group>"; };
118111
674DF03F2B11257D00828016 /* NavigationLink+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NavigationLink+.swift"; sourceTree = "<group>"; };
119112
674E704D2B24D382008AE9D0 /* LoggerScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerScreen.swift; sourceTree = "<group>"; };
120-
675083AA297C0A60008D8C52 /* WorkoutAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WorkoutAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
121113
67515698283FEC3100501346 /* PickedImagesGrid.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PickedImagesGrid.swift; sourceTree = "<group>"; };
122114
67551C352AEC338600084A35 /* SWAddress.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SWAddress.swift; sourceTree = "<group>"; };
123115
6758463A2965B0F6000BA5E0 /* UIImage+Identifiable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Identifiable.swift"; sourceTree = "<group>"; };
@@ -135,6 +127,7 @@
135127
6762775A283A87AD009C203F /* JournalCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JournalCell.swift; sourceTree = "<group>"; };
136128
6766A035284603CA0033F1E8 /* TabViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabViewModel.swift; sourceTree = "<group>"; };
137129
677311192965FFAA003CD13A /* PreviewContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewContent.swift; sourceTree = "<group>"; };
130+
677717162B36D87200ED90BD /* SwiftUI-WorkoutApp.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "SwiftUI-WorkoutApp.xctestplan"; sourceTree = "<group>"; };
138131
67891E37283E947B00B10802 /* SportsGroundFormView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SportsGroundFormView.swift; sourceTree = "<group>"; };
139132
678E3B1A2ACDEA9D00977EEC /* SWNetworkClient */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = SWNetworkClient; path = "SwiftUI-WorkoutApp/SWNetworkClient"; sourceTree = "<group>"; };
140133
6798AA3A280AEDC900DB76F1 /* WorkoutApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WorkoutApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -180,13 +173,6 @@
180173
);
181174
runOnlyForDeploymentPostprocessing = 0;
182175
};
183-
675083A7297C0A60008D8C52 /* Frameworks */ = {
184-
isa = PBXFrameworksBuildPhase;
185-
buildActionMask = 2147483647;
186-
files = (
187-
);
188-
runOnlyForDeploymentPostprocessing = 0;
189-
};
190176
6798AA37280AEDC900DB76F1 /* Frameworks */ = {
191177
isa = PBXFrameworksBuildPhase;
192178
buildActionMask = 2147483647;
@@ -422,14 +408,14 @@
422408
children = (
423409
6798AA3A280AEDC900DB76F1 /* WorkoutApp.app */,
424410
67138D84297311BD00BBF450 /* WorkoutAppUITests.xctest */,
425-
675083AA297C0A60008D8C52 /* WorkoutAppTests.xctest */,
426411
);
427412
name = Products;
428413
sourceTree = "<group>";
429414
};
430415
6798AA3C280AEDC900DB76F1 /* SwiftUI-WorkoutApp */ = {
431416
isa = PBXGroup;
432417
children = (
418+
677717162B36D87200ED90BD /* SwiftUI-WorkoutApp.xctestplan */,
433419
6798AA3D280AEDC900DB76F1 /* SwiftUI_WorkoutAppApp.swift */,
434420
6758B93A281E74DF001D83D8 /* Extensions */,
435421
6798AA62280B1A5A00DB76F1 /* Services */,
@@ -623,24 +609,6 @@
623609
productReference = 67138D84297311BD00BBF450 /* WorkoutAppUITests.xctest */;
624610
productType = "com.apple.product-type.bundle.ui-testing";
625611
};
626-
675083A9297C0A60008D8C52 /* WorkoutAppTests */ = {
627-
isa = PBXNativeTarget;
628-
buildConfigurationList = 675083B2297C0A60008D8C52 /* Build configuration list for PBXNativeTarget "WorkoutAppTests" */;
629-
buildPhases = (
630-
675083A6297C0A60008D8C52 /* Sources */,
631-
675083A7297C0A60008D8C52 /* Frameworks */,
632-
675083A8297C0A60008D8C52 /* Resources */,
633-
);
634-
buildRules = (
635-
);
636-
dependencies = (
637-
675083AF297C0A60008D8C52 /* PBXTargetDependency */,
638-
);
639-
name = WorkoutAppTests;
640-
productName = WorkoutAppTests;
641-
productReference = 675083AA297C0A60008D8C52 /* WorkoutAppTests.xctest */;
642-
productType = "com.apple.product-type.bundle.unit-test";
643-
};
644612
6798AA39280AEDC900DB76F1 /* SwiftUI-WorkoutApp */ = {
645613
isa = PBXNativeTarget;
646614
buildConfigurationList = 6798AA48280AEDCA00DB76F1 /* Build configuration list for PBXNativeTarget "SwiftUI-WorkoutApp" */;
@@ -682,10 +650,6 @@
682650
CreatedOnToolsVersion = 14.2;
683651
TestTargetID = 6798AA39280AEDC900DB76F1;
684652
};
685-
675083A9297C0A60008D8C52 = {
686-
CreatedOnToolsVersion = 14.2;
687-
TestTargetID = 6798AA39280AEDC900DB76F1;
688-
};
689653
6798AA39280AEDC900DB76F1 = {
690654
CreatedOnToolsVersion = 13.3.1;
691655
};
@@ -714,7 +678,6 @@
714678
targets = (
715679
6798AA39280AEDC900DB76F1 /* SwiftUI-WorkoutApp */,
716680
67138D83297311BD00BBF450 /* WorkoutAppUITests */,
717-
675083A9297C0A60008D8C52 /* WorkoutAppTests */,
718681
);
719682
};
720683
/* End PBXProject section */
@@ -727,13 +690,6 @@
727690
);
728691
runOnlyForDeploymentPostprocessing = 0;
729692
};
730-
675083A8297C0A60008D8C52 /* Resources */ = {
731-
isa = PBXResourcesBuildPhase;
732-
buildActionMask = 2147483647;
733-
files = (
734-
);
735-
runOnlyForDeploymentPostprocessing = 0;
736-
};
737693
6798AA38280AEDC900DB76F1 /* Resources */ = {
738694
isa = PBXResourcesBuildPhase;
739695
buildActionMask = 2147483647;
@@ -761,13 +717,6 @@
761717
);
762718
runOnlyForDeploymentPostprocessing = 0;
763719
};
764-
675083A6297C0A60008D8C52 /* Sources */ = {
765-
isa = PBXSourcesBuildPhase;
766-
buildActionMask = 2147483647;
767-
files = (
768-
);
769-
runOnlyForDeploymentPostprocessing = 0;
770-
};
771720
6798AA36280AEDC900DB76F1 /* Sources */ = {
772721
isa = PBXSourcesBuildPhase;
773722
buildActionMask = 2147483647;
@@ -837,11 +786,6 @@
837786
target = 6798AA39280AEDC900DB76F1 /* SwiftUI-WorkoutApp */;
838787
targetProxy = 67138D8A297311BD00BBF450 /* PBXContainerItemProxy */;
839788
};
840-
675083AF297C0A60008D8C52 /* PBXTargetDependency */ = {
841-
isa = PBXTargetDependency;
842-
target = 6798AA39280AEDC900DB76F1 /* SwiftUI-WorkoutApp */;
843-
targetProxy = 675083AE297C0A60008D8C52 /* PBXContainerItemProxy */;
844-
};
845789
/* End PBXTargetDependency section */
846790

847791
/* Begin XCBuildConfiguration section */
@@ -890,53 +834,6 @@
890834
};
891835
name = Release;
892836
};
893-
675083B0297C0A60008D8C52 /* Debug */ = {
894-
isa = XCBuildConfiguration;
895-
buildSettings = {
896-
BUNDLE_LOADER = "$(TEST_HOST)";
897-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
898-
CODE_SIGN_STYLE = Automatic;
899-
CURRENT_PROJECT_VERSION = 1;
900-
DEVELOPMENT_TEAM = 3PHS45582J;
901-
GENERATE_INFOPLIST_FILE = YES;
902-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
903-
MARKETING_VERSION = 1.0;
904-
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
905-
PRODUCT_BUNDLE_IDENTIFIER = com.oleg991.WorkoutAppTests;
906-
PRODUCT_NAME = "$(TARGET_NAME)";
907-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
908-
SUPPORTS_MACCATALYST = NO;
909-
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
910-
SWIFT_EMIT_LOC_STRINGS = NO;
911-
SWIFT_VERSION = 5.0;
912-
TARGETED_DEVICE_FAMILY = 1;
913-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WorkoutApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/WorkoutApp";
914-
};
915-
name = Debug;
916-
};
917-
675083B1297C0A60008D8C52 /* Release */ = {
918-
isa = XCBuildConfiguration;
919-
buildSettings = {
920-
BUNDLE_LOADER = "$(TEST_HOST)";
921-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
922-
CODE_SIGN_STYLE = Automatic;
923-
CURRENT_PROJECT_VERSION = 1;
924-
DEVELOPMENT_TEAM = 3PHS45582J;
925-
GENERATE_INFOPLIST_FILE = YES;
926-
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
927-
MARKETING_VERSION = 1.0;
928-
PRODUCT_BUNDLE_IDENTIFIER = com.oleg991.WorkoutAppTests;
929-
PRODUCT_NAME = "$(TARGET_NAME)";
930-
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
931-
SUPPORTS_MACCATALYST = NO;
932-
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
933-
SWIFT_EMIT_LOC_STRINGS = NO;
934-
SWIFT_VERSION = 5.0;
935-
TARGETED_DEVICE_FAMILY = 1;
936-
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/WorkoutApp.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/WorkoutApp";
937-
};
938-
name = Release;
939-
};
940837
6798AA46280AEDCA00DB76F1 /* Debug */ = {
941838
isa = XCBuildConfiguration;
942839
buildSettings = {
@@ -1097,7 +994,7 @@
1097994
"$(inherited)",
1098995
"@executable_path/Frameworks",
1099996
);
1100-
MARKETING_VERSION = 3.5.5;
997+
MARKETING_VERSION = 3.5.6;
1101998
PRODUCT_BUNDLE_IDENTIFIER = com.FGU.WorkOut;
1102999
PRODUCT_NAME = WorkoutApp;
11031000
RUN_CLANG_STATIC_ANALYZER = YES;
@@ -1146,7 +1043,7 @@
11461043
"$(inherited)",
11471044
"@executable_path/Frameworks",
11481045
);
1149-
MARKETING_VERSION = 3.5.5;
1046+
MARKETING_VERSION = 3.5.6;
11501047
PRODUCT_BUNDLE_IDENTIFIER = com.FGU.WorkOut;
11511048
PRODUCT_NAME = WorkoutApp;
11521049
RUN_CLANG_STATIC_ANALYZER = YES;
@@ -1173,15 +1070,6 @@
11731070
defaultConfigurationIsVisible = 0;
11741071
defaultConfigurationName = Release;
11751072
};
1176-
675083B2297C0A60008D8C52 /* Build configuration list for PBXNativeTarget "WorkoutAppTests" */ = {
1177-
isa = XCConfigurationList;
1178-
buildConfigurations = (
1179-
675083B0297C0A60008D8C52 /* Debug */,
1180-
675083B1297C0A60008D8C52 /* Release */,
1181-
);
1182-
defaultConfigurationIsVisible = 0;
1183-
defaultConfigurationName = Release;
1184-
};
11851073
6798AA35280AEDC900DB76F1 /* Build configuration list for PBXProject "SwiftUI-WorkoutApp" */ = {
11861074
isa = XCConfigurationList;
11871075
buildConfigurations = (

SwiftUI-WorkoutApp.xcodeproj/xcshareddata/xcschemes/SwiftUI-WorkoutApp.xcscheme

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
shouldUseLaunchSchemeArgsEnv = "YES"
3030
language = "ru"
3131
region = "RU">
32+
<TestPlans>
33+
<TestPlanReference
34+
reference = "container:SwiftUI-WorkoutApp/SwiftUI-WorkoutApp.xctestplan"
35+
default = "YES">
36+
</TestPlanReference>
37+
</TestPlans>
3238
<Testables>
3339
<TestableReference
3440
skipped = "NO"

SwiftUI-WorkoutApp.xcodeproj/xcuserdata/oleg991.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1510"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "SWModels"
18+
BuildableName = "SWModels"
19+
BlueprintName = "SWModels"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES"
30+
shouldAutocreateTestPlan = "YES">
31+
</TestAction>
32+
<LaunchAction
33+
buildConfiguration = "Debug"
34+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
35+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
36+
launchStyle = "0"
37+
useCustomWorkingDirectory = "NO"
38+
ignoresPersistentStateOnLaunch = "NO"
39+
debugDocumentVersioning = "YES"
40+
debugServiceExtension = "internal"
41+
allowLocationSimulation = "YES">
42+
</LaunchAction>
43+
<ProfileAction
44+
buildConfiguration = "Release"
45+
shouldUseLaunchSchemeArgsEnv = "YES"
46+
savedToolIdentifier = ""
47+
useCustomWorkingDirectory = "NO"
48+
debugDocumentVersioning = "YES">
49+
<MacroExpansion>
50+
<BuildableReference
51+
BuildableIdentifier = "primary"
52+
BlueprintIdentifier = "SWModels"
53+
BuildableName = "SWModels"
54+
BlueprintName = "SWModels"
55+
ReferencedContainer = "container:">
56+
</BuildableReference>
57+
</MacroExpansion>
58+
</ProfileAction>
59+
<AnalyzeAction
60+
buildConfiguration = "Debug">
61+
</AnalyzeAction>
62+
<ArchiveAction
63+
buildConfiguration = "Release"
64+
revealArchiveInOrganizer = "YES">
65+
</ArchiveAction>
66+
</Scheme>

SwiftUI-WorkoutApp.xcodeproj/xcshareddata/xcschemes/WorkoutAppTests.xcscheme renamed to SwiftUI-WorkoutApp/SWModels/.swiftpm/xcode/xcshareddata/xcschemes/SWModelsTest.xcscheme

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1500"
4-
version = "1.3">
3+
LastUpgradeVersion = "1510"
4+
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
@@ -10,17 +10,17 @@
1010
buildConfiguration = "Debug"
1111
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
1212
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
13-
shouldUseLaunchSchemeArgsEnv = "YES">
13+
shouldUseLaunchSchemeArgsEnv = "YES"
14+
shouldAutocreateTestPlan = "YES">
1415
<Testables>
1516
<TestableReference
16-
skipped = "NO"
17-
parallelizable = "YES">
17+
skipped = "NO">
1818
<BuildableReference
1919
BuildableIdentifier = "primary"
20-
BlueprintIdentifier = "675083A9297C0A60008D8C52"
21-
BuildableName = "WorkoutAppTests.xctest"
22-
BlueprintName = "WorkoutAppTests"
23-
ReferencedContainer = "container:SwiftUI-WorkoutApp.xcodeproj">
20+
BlueprintIdentifier = "SWModelsTest"
21+
BuildableName = "SWModelsTest"
22+
BlueprintName = "SWModelsTest"
23+
ReferencedContainer = "container:">
2424
</BuildableReference>
2525
</TestableReference>
2626
</Testables>

0 commit comments

Comments
 (0)