-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViewModelにcontext渡さない #112
ViewModelにcontext渡さない #112
Conversation
JaCoCo Code Coverage 0.58% ✅
Generated by 🚫 Danger |
convertHistoryDataList.value.removeIf { it.id == id } | ||
} | ||
} | ||
//class ConvertHistoryRepositoryImplTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// convertHistoryRepositoryImpl.deleteConvertHistory(id = histories[1].id) | ||
// assertThat(convertHistoryRepositoryImpl.getAllConvertHistory().size).isEqualTo(2) | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// } | ||
//} | ||
// | ||
//private class FakeConvertHistoryDao : ConvertHistoryDao { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// override fun deleteConvertHistory(id: Long) { | ||
// convertHistoryDataList.value.removeIf { it.id == id } | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
} | ||
} | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
} | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) | ||
//@RunWith(RobolectricTestRunner::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) | ||
//@RunWith(RobolectricTestRunner::class) | ||
//class DataStoreRepositoryImplTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// } | ||
// } | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
testData.removeIf { deleteTarget -> deleteTarget.id == id } | ||
} | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
} | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) | ||
//class ConvertHistoryViewModelImplTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// } | ||
// | ||
// // ■ 変換履歴の詳細ダイアログに関するテスト ------------------------------------------------- End | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// // ■ 変換履歴の詳細ダイアログに関するテスト ------------------------------------------------- End | ||
//} | ||
// | ||
//private class FakeConvertHistoryRepository(exitsInitData: Boolean) : ConvertHistoryRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// override fun deleteConvertHistory(id: Long) { | ||
// testData.removeIf { deleteTarget -> deleteTarget.id == id } | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
override suspend fun updateCustomFont(newCustomFont: CustomFont) {} | ||
override suspend fun checkReachedConvertMaxLimit(today: String) = isReachedConvertMaxLimit | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
override suspend fun checkReachedConvertMaxLimit(today: String) = isReachedConvertMaxLimit | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) | ||
//@RunWith(RobolectricTestRunner::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) | ||
//@RunWith(RobolectricTestRunner::class) | ||
//class ConvertViewModelImplTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// assertThat(viewModel.uiState.value.outputText).isNotEqualTo("") | ||
// } | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// } | ||
//} | ||
// | ||
//private fun createTestingConvertViewModel( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// testDispatcher: CoroutineDispatcher, | ||
// isErrorResponse: Boolean, | ||
// isReachedConvertMaxLimit: Boolean, | ||
//): ConvertViewModelImpl { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// ioDispatcher = testDispatcher, | ||
// defaultDispatcher = testDispatcher, | ||
// ) | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// ) | ||
//} | ||
// | ||
//@OptIn(ExperimentalSerializationApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
//} | ||
// | ||
//@OptIn(ExperimentalSerializationApi::class) | ||
//private class FakeConverterRepository( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
//private class FakeConverterRepository( | ||
// context: Context, | ||
// isErrorResponse: Boolean, | ||
//) : ConvertRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// val body = json.toRequestBody(contentType) | ||
// return runBlocking { convertService.requestConvert(body) } | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// } | ||
//} | ||
// | ||
//private class FakeInterceptor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
//private class FakeInterceptor( | ||
// private val isErrorResponse: Boolean, | ||
// private val context: Context, | ||
//) : Interceptor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// .request(request) | ||
// .build() | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// } | ||
//} | ||
// | ||
//private class FakeConvertHistoryRepositoryImpl : ConvertHistoryRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// override fun getAllConvertHistory(): List<ConvertHistoryData> = emptyList() | ||
// override fun deleteAllConvertHistory() {} | ||
// override fun deleteConvertHistory(id: Long) {} | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// override fun deleteConvertHistory(id: Long) {} | ||
//} | ||
// | ||
//private class FakeDataStoreRepositoryImpl( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// | ||
//private class FakeDataStoreRepositoryImpl( | ||
// private val isReachedConvertMaxLimit: Boolean, | ||
//) : DataStoreRepository { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// override suspend fun updateThemeNum(newThemeNum: Int) {} | ||
// override suspend fun updateCustomFont(newCustomFont: CustomFont) {} | ||
// override suspend fun checkReachedConvertMaxLimit(today: String) = isReachedConvertMaxLimit | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
assertThat(viewModel.isSelectedFont(CustomFont.DEFAULT)).isFalse() | ||
} | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
} | ||
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) | ||
//@RunWith(RobolectricTestRunner::class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
} | ||
//@OptIn(ExperimentalCoroutinesApi::class) | ||
//@RunWith(RobolectricTestRunner::class) | ||
//class SettingsViewModelImplTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
// assertThat(viewModel.isSelectedFont(CustomFont.BIZ_UDGOTHIC)).isTrue() | ||
// assertThat(viewModel.isSelectedFont(CustomFont.DEFAULT)).isFalse() | ||
// } | ||
//} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after // |
Issue
#97
Overview
ErrorInterceptor
にもApplicationContextを渡してしまっていたのでConvertViewModel
のメソッドconvert
と併せてcontextを渡さないようにしたConvertErrorType
、カスタムException3種類(ConvertTextUseCaseError.kt
))を経由するようにした