-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat] #235 - 일기 첨삭 2차 QA
- Loading branch information
Showing
6 changed files
with
114 additions
and
21 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
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
File renamed without changes.
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
89 changes: 89 additions & 0 deletions
89
Smeem-iOS/Smeem-iOSTests/Coaching/Store/CoachingStoreTest.swift
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,89 @@ | ||
// | ||
// CoachingStore.swift | ||
// Smeem-iOSTests | ||
// | ||
// Created by 황찬미 on 12/10/24. | ||
// | ||
|
||
import XCTest | ||
|
||
@testable import Smeem_iOS | ||
|
||
final class CoachingStoreTest: XCTestCase { | ||
|
||
var sut: CoachingStore! | ||
var service: CoachingServiceProtocol! | ||
|
||
override func setUpWithError() throws { | ||
service = CoachingService() | ||
sut = CoachingStore(service: service, | ||
diaryResponse: PostDiaryResponse.empty) | ||
} | ||
|
||
override func tearDownWithError() throws { | ||
sut = nil | ||
} | ||
|
||
func test_첨삭데이터15개일때_10개로잘필터하는지() { | ||
// Given | ||
var filterResult = [CoachingResponse]() | ||
for _ in 1...15 { | ||
filterResult.append(CoachingResponse(originalSentence: "", | ||
correctedSentence: "", | ||
reason: "", | ||
isCorrected: true)) | ||
} | ||
|
||
var expectedResult = [CoachingResponse]() | ||
for _ in 1...10 { | ||
expectedResult.append(CoachingResponse(originalSentence: "", | ||
correctedSentence: "", | ||
reason: "", | ||
isCorrected: true)) | ||
} | ||
|
||
// When | ||
let outputResult = sut.filiterCorrection(filterResult) | ||
|
||
// Then | ||
XCTAssertEqual(outputResult, expectedResult) | ||
} | ||
|
||
func test_첨삭데이터0개일때_0개로잘필터하는지() { | ||
// Given | ||
var filterResult = [CoachingResponse]() | ||
for _ in 1...15 { | ||
filterResult.append(CoachingResponse(originalSentence: "", | ||
correctedSentence: "", | ||
reason: "", | ||
isCorrected: false)) | ||
} | ||
|
||
var expectedResult = [CoachingResponse]() | ||
|
||
// When | ||
let outputResult = sut.filiterCorrection(filterResult) | ||
|
||
// Then | ||
XCTAssertEqual(outputResult, expectedResult) | ||
} | ||
|
||
func test_원문일기_잘조합해주는지() { | ||
// Given | ||
var filterResult = [CoachingResponse]() | ||
for i in 1...3 { | ||
filterResult.append(CoachingResponse(originalSentence: "안녕", | ||
correctedSentence: "", | ||
reason: "", | ||
isCorrected: false)) | ||
} | ||
|
||
var expectedResult = "안녕 안녕 안녕" | ||
|
||
// When | ||
let outputResult = sut.combineCorrectionText(filterResult) | ||
|
||
// Then | ||
XCTAssertEqual(outputResult, expectedResult) | ||
} | ||
} |