Skip to content

Commit 158dcfb

Browse files
authored
Merge pull request #60 from boostcampwm-2024/feat/#53-add-sticker-feature
[FEAT/#53] 스티커를 추가 기능 및 테스트 코드 구현
2 parents ac836eb + eb19ade commit 158dcfb

File tree

52 files changed

+857
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+857
-40
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import XCTest
2+
import PhotoGetherDomainTesting
3+
import PhotoGetherDomainInterface
4+
import PhotoGetherDomain
5+
6+
final class FetchStickerListUseCaseTests: XCTestCase {
7+
var sut: FetchStickerListUseCase!
8+
var shapeRepositoryMock: ShapeRepositoryMock!
9+
10+
func test_이미지데이터_리스트를_번들에서_잘_가져오는지() {
11+
//Arrange 준비 단계: 테스트 대상 시스템(SUT)와 의존성을 원하는 상태로 만들기
12+
let expectation = XCTestExpectation(description: "이미지 데이터 리스트 가져오기 테스트")
13+
let imageNameList = [
14+
"blackHeart",
15+
"bug",
16+
"cat",
17+
"crown",
18+
"dog",
19+
"lips",
20+
"parkBug",
21+
"racoon",
22+
"redHeart",
23+
"star",
24+
"sunglasses",
25+
"tree",
26+
]
27+
let shapeRepositoryMock = ShapeRepositoryMock(imageNameList: imageNameList)
28+
29+
sut = FetchStickerListUseCaseImpl(shapeRepository: shapeRepositoryMock)
30+
31+
var targetDataList: [Data] = []
32+
let beforeDataListCount = 0
33+
34+
//Act 실행 단계: SUT 메소드를 호출하면서 의존성을 전달해서 결과를 저장하기
35+
let cancellable = sut.execute()
36+
.sink { datas in
37+
targetDataList.append(contentsOf: datas)
38+
expectation.fulfill()
39+
}
40+
41+
//Assert 검증 단계: 결과와 기대치를 비교해서 검증하기
42+
wait(for: [expectation], timeout: 2.0)
43+
XCTAssertEqual(beforeDataListCount, 0)
44+
XCTAssertEqual(targetDataList.count, 12)
45+
46+
cancellable.cancel()
47+
}
48+
}

PhotoGether/DomainLayer/PhotoGetherDomain/PhotoGetherDomain.xcodeproj/project.pbxproj

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
603C68CF2CEC51EC00BE7AF9 /* PhotoGetherDomain.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B5951872CDB647A00B89C85 /* PhotoGetherDomain.framework */; platformFilter = ios; };
11+
603C68D52CEC529000BE7AF9 /* PhotoGetherDomainTesting.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B5951A72CDB64F800B89C85 /* PhotoGetherDomainTesting.framework */; platformFilter = ios; };
12+
603C68D62CEC529000BE7AF9 /* PhotoGetherDomainTesting.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7B5951A72CDB64F800B89C85 /* PhotoGetherDomainTesting.framework */; platformFilter = ios; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1013
7B1745512CE35CD500E01D1A /* WebRTC in Frameworks */ = {isa = PBXBuildFile; productRef = 7B1745502CE35CD500E01D1A /* WebRTC */; };
1114
7B5951BE2CDB655500B89C85 /* PhotoGetherDomainInterface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7B59519A2CDB64E000B89C85 /* PhotoGetherDomainInterface.framework */; };
1215
7B5951BF2CDB655500B89C85 /* PhotoGetherDomainInterface.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7B59519A2CDB64E000B89C85 /* PhotoGetherDomainInterface.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -15,6 +18,20 @@
1518
/* End PBXBuildFile section */
1619

1720
/* Begin PBXContainerItemProxy section */
21+
603C68D02CEC51EC00BE7AF9 /* PBXContainerItemProxy */ = {
22+
isa = PBXContainerItemProxy;
23+
containerPortal = 7B59517E2CDB647A00B89C85 /* Project object */;
24+
proxyType = 1;
25+
remoteGlobalIDString = 7B5951862CDB647A00B89C85;
26+
remoteInfo = PhotoGetherDomain;
27+
};
28+
603C68D72CEC529000BE7AF9 /* PBXContainerItemProxy */ = {
29+
isa = PBXContainerItemProxy;
30+
containerPortal = 7B59517E2CDB647A00B89C85 /* Project object */;
31+
proxyType = 1;
32+
remoteGlobalIDString = 7B5951A62CDB64F800B89C85;
33+
remoteInfo = PhotoGetherDomainTesting;
34+
};
1835
7B5951C02CDB655500B89C85 /* PBXContainerItemProxy */ = {
1936
isa = PBXContainerItemProxy;
2037
containerPortal = 7B59517E2CDB647A00B89C85 /* Project object */;
@@ -32,6 +49,17 @@
3249
/* End PBXContainerItemProxy section */
3350

3451
/* Begin PBXCopyFilesBuildPhase section */
52+
603C68D92CEC529100BE7AF9 /* Embed Frameworks */ = {
53+
isa = PBXCopyFilesBuildPhase;
54+
buildActionMask = 2147483647;
55+
dstPath = "";
56+
dstSubfolderSpec = 10;
57+
files = (
58+
603C68D62CEC529000BE7AF9 /* PhotoGetherDomainTesting.framework in Embed Frameworks */,
59+
);
60+
name = "Embed Frameworks";
61+
runOnlyForDeploymentPostprocessing = 0;
62+
};
3563
7B5951C22CDB655500B89C85 /* Embed Frameworks */ = {
3664
isa = PBXCopyFilesBuildPhase;
3765
buildActionMask = 2147483647;
@@ -58,12 +86,19 @@
5886

5987
/* Begin PBXFileReference section */
6088
05E553E92CDB9C4A00B70645 /* DomainUtility.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DomainUtility.framework; sourceTree = BUILT_PRODUCTS_DIR; };
89+
603C68C02CEC4C3400BE7AF9 /* DesignSystem.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DesignSystem.framework; sourceTree = BUILT_PRODUCTS_DIR; };
90+
603C68CB2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FetchStickerListUseCaseTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
6191
7B5951872CDB647A00B89C85 /* PhotoGetherDomain.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PhotoGetherDomain.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6292
7B59519A2CDB64E000B89C85 /* PhotoGetherDomainInterface.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PhotoGetherDomainInterface.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6393
7B5951A72CDB64F800B89C85 /* PhotoGetherDomainTesting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PhotoGetherDomainTesting.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6494
/* End PBXFileReference section */
6595

6696
/* Begin PBXFileSystemSynchronizedRootGroup section */
97+
603C68CC2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests */ = {
98+
isa = PBXFileSystemSynchronizedRootGroup;
99+
path = FetchStickerListUseCaseTests;
100+
sourceTree = "<group>";
101+
};
67102
7B1746352CE8E97000E01D1A /* PhotoGetherDomain */ = {
68103
isa = PBXFileSystemSynchronizedRootGroup;
69104
path = PhotoGetherDomain;
@@ -82,6 +117,15 @@
82117
/* End PBXFileSystemSynchronizedRootGroup section */
83118

84119
/* Begin PBXFrameworksBuildPhase section */
120+
603C68C82CEC51EC00BE7AF9 /* Frameworks */ = {
121+
isa = PBXFrameworksBuildPhase;
122+
buildActionMask = 2147483647;
123+
files = (
124+
603C68CF2CEC51EC00BE7AF9 /* PhotoGetherDomain.framework in Frameworks */,
125+
603C68D52CEC529000BE7AF9 /* PhotoGetherDomainTesting.framework in Frameworks */,
126+
);
127+
runOnlyForDeploymentPostprocessing = 0;
128+
};
85129
7B5951842CDB647A00B89C85 /* Frameworks */ = {
86130
isa = PBXFrameworksBuildPhase;
87131
buildActionMask = 2147483647;
@@ -115,6 +159,7 @@
115159
7B1746352CE8E97000E01D1A /* PhotoGetherDomain */,
116160
7B1746472CE8E97300E01D1A /* PhotoGetherDomainInterface */,
117161
7B1746542CE8E97A00E01D1A /* PhotoGetherDomainTesting */,
162+
603C68CC2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests */,
118163
7B5951BD2CDB655500B89C85 /* Frameworks */,
119164
7B5951882CDB647A00B89C85 /* Products */,
120165
);
@@ -126,13 +171,15 @@
126171
7B5951872CDB647A00B89C85 /* PhotoGetherDomain.framework */,
127172
7B59519A2CDB64E000B89C85 /* PhotoGetherDomainInterface.framework */,
128173
7B5951A72CDB64F800B89C85 /* PhotoGetherDomainTesting.framework */,
174+
603C68CB2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests.xctest */,
129175
);
130176
name = Products;
131177
sourceTree = "<group>";
132178
};
133179
7B5951BD2CDB655500B89C85 /* Frameworks */ = {
134180
isa = PBXGroup;
135181
children = (
182+
603C68C02CEC4C3400BE7AF9 /* DesignSystem.framework */,
136183
05E553E92CDB9C4A00B70645 /* DomainUtility.framework */,
137184
);
138185
name = Frameworks;
@@ -165,6 +212,31 @@
165212
/* End PBXHeadersBuildPhase section */
166213

167214
/* Begin PBXNativeTarget section */
215+
603C68CA2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests */ = {
216+
isa = PBXNativeTarget;
217+
buildConfigurationList = 603C68D22CEC51EC00BE7AF9 /* Build configuration list for PBXNativeTarget "FetchStickerListUseCaseTests" */;
218+
buildPhases = (
219+
603C68C72CEC51EC00BE7AF9 /* Sources */,
220+
603C68C82CEC51EC00BE7AF9 /* Frameworks */,
221+
603C68C92CEC51EC00BE7AF9 /* Resources */,
222+
603C68D92CEC529100BE7AF9 /* Embed Frameworks */,
223+
);
224+
buildRules = (
225+
);
226+
dependencies = (
227+
603C68D12CEC51EC00BE7AF9 /* PBXTargetDependency */,
228+
603C68D82CEC529000BE7AF9 /* PBXTargetDependency */,
229+
);
230+
fileSystemSynchronizedGroups = (
231+
603C68CC2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests */,
232+
);
233+
name = FetchStickerListUseCaseTests;
234+
packageProductDependencies = (
235+
);
236+
productName = FetchStickerListUseCaseTests;
237+
productReference = 603C68CB2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests.xctest */;
238+
productType = "com.apple.product-type.bundle.unit-test";
239+
};
168240
7B5951862CDB647A00B89C85 /* PhotoGetherDomain */ = {
169241
isa = PBXNativeTarget;
170242
buildConfigurationList = 7B59518D2CDB647A00B89C85 /* Build configuration list for PBXNativeTarget "PhotoGetherDomain" */;
@@ -246,8 +318,12 @@
246318
isa = PBXProject;
247319
attributes = {
248320
BuildIndependentTargetsInParallel = 1;
321+
LastSwiftUpdateCheck = 1600;
249322
LastUpgradeCheck = 1600;
250323
TargetAttributes = {
324+
603C68CA2CEC51EC00BE7AF9 = {
325+
CreatedOnToolsVersion = 16.0;
326+
};
251327
7B5951862CDB647A00B89C85 = {
252328
CreatedOnToolsVersion = 16.0;
253329
};
@@ -281,11 +357,19 @@
281357
7B5951862CDB647A00B89C85 /* PhotoGetherDomain */,
282358
7B5951992CDB64E000B89C85 /* PhotoGetherDomainInterface */,
283359
7B5951A62CDB64F800B89C85 /* PhotoGetherDomainTesting */,
360+
603C68CA2CEC51EC00BE7AF9 /* FetchStickerListUseCaseTests */,
284361
);
285362
};
286363
/* End PBXProject section */
287364

288365
/* Begin PBXResourcesBuildPhase section */
366+
603C68C92CEC51EC00BE7AF9 /* Resources */ = {
367+
isa = PBXResourcesBuildPhase;
368+
buildActionMask = 2147483647;
369+
files = (
370+
);
371+
runOnlyForDeploymentPostprocessing = 0;
372+
};
289373
7B5951852CDB647A00B89C85 /* Resources */ = {
290374
isa = PBXResourcesBuildPhase;
291375
buildActionMask = 2147483647;
@@ -310,6 +394,13 @@
310394
/* End PBXResourcesBuildPhase section */
311395

312396
/* Begin PBXSourcesBuildPhase section */
397+
603C68C72CEC51EC00BE7AF9 /* Sources */ = {
398+
isa = PBXSourcesBuildPhase;
399+
buildActionMask = 2147483647;
400+
files = (
401+
);
402+
runOnlyForDeploymentPostprocessing = 0;
403+
};
313404
7B5951832CDB647A00B89C85 /* Sources */ = {
314405
isa = PBXSourcesBuildPhase;
315406
buildActionMask = 2147483647;
@@ -334,6 +425,18 @@
334425
/* End PBXSourcesBuildPhase section */
335426

336427
/* Begin PBXTargetDependency section */
428+
603C68D12CEC51EC00BE7AF9 /* PBXTargetDependency */ = {
429+
isa = PBXTargetDependency;
430+
platformFilter = ios;
431+
target = 7B5951862CDB647A00B89C85 /* PhotoGetherDomain */;
432+
targetProxy = 603C68D02CEC51EC00BE7AF9 /* PBXContainerItemProxy */;
433+
};
434+
603C68D82CEC529000BE7AF9 /* PBXTargetDependency */ = {
435+
isa = PBXTargetDependency;
436+
platformFilter = ios;
437+
target = 7B5951A62CDB64F800B89C85 /* PhotoGetherDomainTesting */;
438+
targetProxy = 603C68D72CEC529000BE7AF9 /* PBXContainerItemProxy */;
439+
};
337440
7B5951C12CDB655500B89C85 /* PBXTargetDependency */ = {
338441
isa = PBXTargetDependency;
339442
target = 7B5951992CDB64E000B89C85 /* PhotoGetherDomainInterface */;
@@ -347,6 +450,48 @@
347450
/* End PBXTargetDependency section */
348451

349452
/* Begin XCBuildConfiguration section */
453+
603C68D32CEC51EC00BE7AF9 /* Debug */ = {
454+
isa = XCBuildConfiguration;
455+
buildSettings = {
456+
CODE_SIGN_STYLE = Automatic;
457+
CURRENT_PROJECT_VERSION = 1;
458+
DEVELOPMENT_TEAM = B3PWYBKFUK;
459+
GENERATE_INFOPLIST_FILE = YES;
460+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
461+
MARKETING_VERSION = 1.0;
462+
PRODUCT_BUNDLE_IDENTIFIER = kr.codesquad.boostcamp9.FetchStickerListUseCaseTests;
463+
PRODUCT_NAME = "$(TARGET_NAME)";
464+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
465+
SUPPORTS_MACCATALYST = NO;
466+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
467+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
468+
SWIFT_EMIT_LOC_STRINGS = NO;
469+
SWIFT_VERSION = 5.0;
470+
TARGETED_DEVICE_FAMILY = 1;
471+
};
472+
name = Debug;
473+
};
474+
603C68D42CEC51EC00BE7AF9 /* Release */ = {
475+
isa = XCBuildConfiguration;
476+
buildSettings = {
477+
CODE_SIGN_STYLE = Automatic;
478+
CURRENT_PROJECT_VERSION = 1;
479+
DEVELOPMENT_TEAM = B3PWYBKFUK;
480+
GENERATE_INFOPLIST_FILE = YES;
481+
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
482+
MARKETING_VERSION = 1.0;
483+
PRODUCT_BUNDLE_IDENTIFIER = kr.codesquad.boostcamp9.FetchStickerListUseCaseTests;
484+
PRODUCT_NAME = "$(TARGET_NAME)";
485+
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
486+
SUPPORTS_MACCATALYST = NO;
487+
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
488+
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
489+
SWIFT_EMIT_LOC_STRINGS = NO;
490+
SWIFT_VERSION = 5.0;
491+
TARGETED_DEVICE_FAMILY = 1;
492+
};
493+
name = Release;
494+
};
350495
7B59518E2CDB647A00B89C85 /* Debug */ = {
351496
isa = XCBuildConfiguration;
352497
buildSettings = {
@@ -709,6 +854,15 @@
709854
/* End XCBuildConfiguration section */
710855

711856
/* Begin XCConfigurationList section */
857+
603C68D22CEC51EC00BE7AF9 /* Build configuration list for PBXNativeTarget "FetchStickerListUseCaseTests" */ = {
858+
isa = XCConfigurationList;
859+
buildConfigurations = (
860+
603C68D32CEC51EC00BE7AF9 /* Debug */,
861+
603C68D42CEC51EC00BE7AF9 /* Release */,
862+
);
863+
defaultConfigurationIsVisible = 0;
864+
defaultConfigurationName = Release;
865+
};
712866
7B5951812CDB647A00B89C85 /* Build configuration list for PBXProject "PhotoGetherDomain" */ = {
713867
isa = XCConfigurationList;
714868
buildConfigurations = (
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1600"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
</BuildAction>
10+
<TestAction
11+
buildConfiguration = "Debug"
12+
selectedDebuggerIdentifier = ""
13+
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
14+
shouldUseLaunchSchemeArgsEnv = "YES"
15+
shouldAutocreateTestPlan = "YES">
16+
<Testables>
17+
<TestableReference
18+
skipped = "NO"
19+
parallelizable = "YES">
20+
<BuildableReference
21+
BuildableIdentifier = "primary"
22+
BlueprintIdentifier = "603C68CA2CEC51EC00BE7AF9"
23+
BuildableName = "FetchStickerListUseCaseTests.xctest"
24+
BlueprintName = "FetchStickerListUseCaseTests"
25+
ReferencedContainer = "container:PhotoGetherDomain.xcodeproj">
26+
</BuildableReference>
27+
</TestableReference>
28+
</Testables>
29+
</TestAction>
30+
<LaunchAction
31+
buildConfiguration = "Debug"
32+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
33+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
34+
launchStyle = "0"
35+
useCustomWorkingDirectory = "NO"
36+
ignoresPersistentStateOnLaunch = "NO"
37+
debugDocumentVersioning = "YES"
38+
debugServiceExtension = "internal"
39+
allowLocationSimulation = "YES">
40+
</LaunchAction>
41+
<ProfileAction
42+
buildConfiguration = "Release"
43+
shouldUseLaunchSchemeArgsEnv = "YES"
44+
savedToolIdentifier = ""
45+
useCustomWorkingDirectory = "NO"
46+
debugDocumentVersioning = "YES">
47+
</ProfileAction>
48+
<AnalyzeAction
49+
buildConfiguration = "Debug">
50+
</AnalyzeAction>
51+
<ArchiveAction
52+
buildConfiguration = "Release"
53+
revealArchiveInOrganizer = "YES">
54+
</ArchiveAction>
55+
</Scheme>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Combine
2+
import Foundation
3+
import PhotoGetherDomainInterface
4+
5+
public final class FetchStickerListUseCaseImpl: FetchStickerListUseCase {
6+
public func execute() -> AnyPublisher<[Data], Never> {
7+
return shapeRepository.fetchStickerList()
8+
}
9+
10+
private let shapeRepository: ShapeRepository
11+
12+
public init(shapeRepository: ShapeRepository) {
13+
self.shapeRepository = shapeRepository
14+
}
15+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Combine
2+
import Foundation
3+
4+
public protocol ShapeRepository {
5+
func fetchStickerList() -> AnyPublisher<[Data], Never>
6+
}

0 commit comments

Comments
 (0)