Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
김종권
committed
Jul 14, 2021
1 parent
274e589
commit 6c3ad38
Showing
8 changed files
with
269 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+4.22 KB
(110%)
...oj/project.xcworkspace/xcuserdata/jongkwon-kim.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// OperationUsecase.swift | ||
// TestApp | ||
// | ||
// Created by 김종권 on 2021/07/14. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol AddUsecase { | ||
func execute(a: Int, b: Int) -> Int | ||
} | ||
|
||
class DefaultAddUsecase: AddUsecase { | ||
func execute(a: Int, b: Int) -> Int { | ||
return a + b | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// AddUsecaseTests.swift | ||
// TestAppTests | ||
// | ||
// Created by 김종권 on 2021/07/14. | ||
// | ||
|
||
import XCTest | ||
@testable import TestApp | ||
|
||
class AddUsecaseTests: XCTestCase { | ||
|
||
class MockAddUsecase: AddUsecase { | ||
func execute(a: Int, b: Int) -> Int { | ||
return a * b | ||
} | ||
} | ||
|
||
func test_whenViewDidLoadAndCalculateValue_thenValue() { | ||
// given | ||
let a = 2 | ||
let b = 5 | ||
let usecase = MockAddUsecase() | ||
let viewModel = DefaultAViewModel(addUsecase: usecase, a: a, b: b) | ||
|
||
// when | ||
viewModel.viewDidLoad() | ||
|
||
// then | ||
XCTAssertEqual(viewModel.calculatedValue.value, a * b) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>$(DEVELOPMENT_LANGUAGE)</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
</dict> | ||
</plist> |
Oops, something went wrong.