[skip ci] replace real file in test by resource file

This commit is contained in:
az 2022-09-01 21:02:06 +02:00
parent f7e67625f0
commit a7cf154695
2 changed files with 9 additions and 10 deletions

View file

@ -12,7 +12,7 @@ internal class DefaultApplicationFileRepositoryKtTest {
@Test
fun assertExistsThrowsRuntimeException() {
// when
val invalidFileName: ApplicationFileName = ApplicationFileName("iDontExist")
val invalidFileName = ApplicationFileName("iDontExist")
val repo: ApplicationFileRepository = DefaultApplicationFileRepository()
// then
@ -27,17 +27,15 @@ internal class DefaultApplicationFileRepositoryKtTest {
@Test
fun assertExistsPasses() {
// given
val validFileName = "src/test/resources/existing_file"
// when
val validFileName = "iExist"
File(validFileName).createNewFile()
val validFile: ApplicationFileName =
ApplicationFileName(File(validFileName).absolutePath)
val validFile = ApplicationFileName(File(validFileName).path)
val repo: ApplicationFileRepository = DefaultApplicationFileRepository()
// then
repo.assertExists(validFile)
File(validFileName).deleteOnExit()
// then
// no exception is thrown
}
}

View file

@ -0,0 +1 @@
no content required