Skip to content

Commit c47b9e1

Browse files
committed
Add Swift IAMIntegrationTests test file
Add Swift `IAMIntegrationTests` test file and check for accessibility of `OSMessagingController` from the test file
1 parent a1eea2b commit c47b9e1

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

iOS_SDK/OneSignalSDK/OneSignal.xcodeproj/project.pbxproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
3C277D7E2BD76E0000857606 /* OSIdentityModelRepo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C277D7D2BD76E0000857606 /* OSIdentityModelRepo.swift */; };
7474
3C2C7DC8288F3C020020F9AE /* OSSubscriptionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2C7DC7288F3C020020F9AE /* OSSubscriptionModel.swift */; };
7575
3C2D8A5928B4C4E300BE41F6 /* OSDelta.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C2D8A5828B4C4E300BE41F6 /* OSDelta.swift */; };
76+
3C3FABA52D488DDD00B7090D /* IAMIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C3FABA42D488DDD00B7090D /* IAMIntegrationTests.swift */; };
7677
3C44673E296D099D0039A49E /* OneSignalMobileProvision.m in Sources */ = {isa = PBXBuildFile; fileRef = 912411FD1E73342200E41FD7 /* OneSignalMobileProvision.m */; };
7778
3C44673F296D09CC0039A49E /* OneSignalMobileProvision.h in Headers */ = {isa = PBXBuildFile; fileRef = 912411FC1E73342200E41FD7 /* OneSignalMobileProvision.h */; settings = {ATTRIBUTES = (Public, ); }; };
7879
3C448B9D2936ADFD002F96BC /* OSBackgroundTaskHandlerImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3C448B9B2936ADFD002F96BC /* OSBackgroundTaskHandlerImpl.h */; };
@@ -1251,6 +1252,7 @@
12511252
3C2C7DC2288E007E0020F9AE /* UnitTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UnitTests-Bridging-Header.h"; sourceTree = "<group>"; };
12521253
3C2C7DC7288F3C020020F9AE /* OSSubscriptionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSSubscriptionModel.swift; sourceTree = "<group>"; };
12531254
3C2D8A5828B4C4E300BE41F6 /* OSDelta.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSDelta.swift; sourceTree = "<group>"; };
1255+
3C3FABA42D488DDD00B7090D /* IAMIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IAMIntegrationTests.swift; sourceTree = "<group>"; };
12541256
3C448B9B2936ADFD002F96BC /* OSBackgroundTaskHandlerImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSBackgroundTaskHandlerImpl.h; sourceTree = "<group>"; };
12551257
3C448B9C2936ADFD002F96BC /* OSBackgroundTaskHandlerImpl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OSBackgroundTaskHandlerImpl.m; sourceTree = "<group>"; };
12561258
3C448BA12936B474002F96BC /* OSBackgroundTaskManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSBackgroundTaskManager.swift; sourceTree = "<group>"; };
@@ -2080,6 +2082,7 @@
20802082
isa = PBXGroup;
20812083
children = (
20822084
3C01519B2C2E29F90079E076 /* IAMRequestTests.m */,
2085+
3C3FABA42D488DDD00B7090D /* IAMIntegrationTests.swift */,
20832086
);
20842087
path = OneSignalInAppMessagesTests;
20852088
sourceTree = "<group>";
@@ -3739,7 +3742,7 @@
37393742
};
37403743
3C01518D2C2E298E0079E076 = {
37413744
CreatedOnToolsVersion = 15.2;
3742-
LastSwiftMigration = 1520;
3745+
LastSwiftMigration = 1610;
37433746
TestTargetID = DEF5CCF02539321A0003E9CC;
37443747
};
37453748
3C115160289A259500565C41 = {
@@ -4149,6 +4152,7 @@
41494152
isa = PBXSourcesBuildPhase;
41504153
buildActionMask = 2147483647;
41514154
files = (
4155+
3C3FABA52D488DDD00B7090D /* IAMIntegrationTests.swift in Sources */,
41524156
3C01519C2C2E29F90079E076 /* IAMRequestTests.m in Sources */,
41534157
);
41544158
runOnlyForDeploymentPostprocessing = 0;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
Modified MIT License
3+
4+
Copyright 2024 OneSignal
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
1. The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
2. All copies of substantial portions of the Software may only be used in connection
17+
with services provided by OneSignal.
18+
19+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
THE SOFTWARE.
26+
*/
27+
28+
import XCTest
29+
@testable import OneSignalInAppMessages
30+
31+
final class IAMIntegrationTests: XCTestCase {
32+
override func setUpWithError() throws {
33+
// Put setup code here. This method is called before the invocation of each test method in the class.
34+
}
35+
override func tearDownWithError() throws {
36+
// Put teardown code here. This method is called after the invocation of each test method in the class.
37+
}
38+
func testExample() throws {
39+
OneSignalLog.setLogLevel(.LL_VERBOSE)
40+
OneSignalInAppMessages.getFromServer("foobar")
41+
// OSMessagingController.sharedInstance()
42+
}
43+
}

0 commit comments

Comments
 (0)