Skip to content

Commit

Permalink
[TEST] 변경된 model 테스트 코드 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
cchanmi committed Dec 4, 2024
1 parent f34f89c commit 47af286
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ extension CoachingEndPoint {
"data": {
"corrections": [
{
"original_sentence": "original text",
"corrected_sentence": "corrected text",
"originalSentence": "original text",
"correctedSentence": "corrected text",
"reason": "수정된 문구입니다.",
"is_corrected": true
"isCorrected": true
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@ extension DetailDiaryEndPoint {
"topic": "주제",
"content": "일기 내용입니다",
"createdAt": "2024년 5월 18일",
"username": "찬미"
"username": "찬미",
"corrections": [
{
"originalSentence": "original text",
"correctedSentence": "corrected text",
"reason": "수정된 문구입니다.",
"isCorrected": true
}
],
"correctionCount": 0,
"correctionMaxCount": 1
}
}
""".utf8)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

import Foundation

struct CoachingsResponse: Codable {
struct CoachingsResponse: Codable, Equatable {
static func == (lhs: CoachingsResponse, rhs: CoachingsResponse) -> Bool {
return lhs.corrections == rhs.corrections
}

var corrections: [CoachingResponse]
}

Expand Down Expand Up @@ -44,7 +48,7 @@ extension CoachingsResponse {
)
}

struct CoachingResponse: Codable {
struct CoachingResponse: Codable, Equatable {
let originalSentence: String
let correctedSentence: String
let reason: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Joon Baek on 2023/06/25.
//

struct DetailDiaryResponse: Codable {
struct DetailDiaryResponse: Codable, Equatable {
let diaryId: Int
let topic: String
var content: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,24 @@ final class CoachingServiceTest: XCTestCase {

extension CoachingServiceTest {
var coachingModel: CoachingsResponse {
return CoachingsResponse(corrections: [CoachingResponse(original_sentence: "original text",
corrected_sentence: "corrected text",
return CoachingsResponse(corrections: [CoachingResponse(originalSentence: "original text",
correctedSentence: "corrected text",
reason: "수정된 문구입니다.",
is_corrected: true)])
isCorrected: true)])
}

var detailDiaryResponse: DetailDiaryResponse {
return DetailDiaryResponse(diaryId: 0,
topic: "주제",
content: "일기 내용입니다",
createdAt: "2024년 5월 18일",
username: "찬미")
username: "찬미",
corrections: [CoachingResponse(originalSentence: "original text",
correctedSentence: "corrected text",
reason: "수정된 문구입니다.",
isCorrected: true)],
correctionCount: 0,
correctionMaxCount: 1)
}
}

Expand Down

0 comments on commit 47af286

Please sign in to comment.