Skip to content

Commit

Permalink
[TEST] 강제 업데이트 테스트 코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
cchanmi committed Jan 16, 2025
1 parent d10f249 commit 7b47b00
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Smeem-iOS/Smeem-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "Team.Smeem-dev";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2255,7 +2255,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.1.0;
MARKETING_VERSION = 3.2.0;
PRODUCT_BUNDLE_IDENTIFIER = "Team.Smeem-iOS";
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = smeem_release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ extension SplashViewModel {
// x 버전이 같고, y 버전이 더 크면 강제 업데이트
} else if forceVersion[0] == clientVersion[0] && forceVersion[1] > clientVersion[1] {
return true
// x, y 버전이 같고, z버전이 더 크면 강제 업데이트
// x 버전이 같고, y 버전이 클 때, z버전이 더 크면 강제 업데이트
} else if (forceVersion[0] == clientVersion[0] && forceVersion[1] > clientVersion[1]) && forceVersion[2] > clientVersion[2] {
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ final class SplashViewModelTest: XCTestCase {
override func setUpWithError() throws {
self.mockService = SplashServiceMock()
self.viewModel = SplashViewModel(provider: mockService)
self.beforeAppVersion = "3.0.1"
self.afterAppVersion = "3.1.0"
self.forceVersion = "3.1.0"
self.beforeAppVersion = "3.1.0"
self.afterAppVersion = "3.2.0"
self.forceVersion = "3.2.0"
}

func test_강제업데이트안한유저_정확한데이터_return하는지() {
Expand Down Expand Up @@ -69,6 +69,17 @@ final class SplashViewModelTest: XCTestCase {
// Then
XCTAssertEqual(result, expectedResult)
}

func test_서버로부터_3_2_0_값이내려올때_강제업데이트팝업잘뜨는지() {
// Given
let result = self.viewModel.checkVersion(client: self.beforeAppVersion, force: "3.2.0")

// When
let expectedResult = true

// Then
XCTAssertEqual(result, expectedResult)
}

override func tearDownWithError() throws {
self.mockService = nil
Expand Down

0 comments on commit 7b47b00

Please sign in to comment.