-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
4c7072a
commit d2d3178
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
RaelizeLogic/Tests/RaelizeLogicTests/Repository/WordListFileRepositoryTests.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,48 @@ | ||
// | ||
// WordListFileRepositoryTests.swift | ||
// | ||
// Created by Tatsumi0000 on 2024/04/18 | ||
// | ||
// | ||
|
||
import Combine | ||
import Foundation | ||
import Testing | ||
|
||
@testable import RaelizeLogic | ||
|
||
final class WordListFileRepositoryTests { | ||
|
||
private let repository: any WordListFileRepositoryType | ||
private var cancellables: Set<AnyCancellable> = [] | ||
|
||
init() { | ||
self.repository = RepositoryProvider.shared.wordListFileRepository | ||
} | ||
|
||
deinit { | ||
|
||
} | ||
|
||
@Test | ||
func readFile() { | ||
self.repository.readFile(fileName: "a") | ||
self.repository.getWordList() | ||
.sink(receiveValue: { words in | ||
#expect(!words!.isEmpty) | ||
}) | ||
.store(in: &cancellables) | ||
} | ||
|
||
@Test | ||
func resetFile() { | ||
self.repository.readFile(fileName: "a") | ||
self.repository.resetFile() | ||
self.repository.getWordList() | ||
.sink(receiveValue: { words in | ||
#expect(words == nil) | ||
}) | ||
.store(in: &cancellables) | ||
} | ||
|
||
} |