Skip to content

Commit 801ab45

Browse files
fixed some bugs
1 parent 7c39112 commit 801ab45

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

generator/src/test/kotlin/io/github/hosseinkarami_dev/near/rpc/generator/ModelsGenerationTest.kt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ import java.io.File
55
import kotlin.test.assertTrue
66

77
class ModelsGenerationTest {
8-
//
9-
// @Test
10-
// fun `models directory should not be empty`() {
11-
// val modelsDir = File(MODELS_DIR)
12-
// assertTrue(modelsDir.exists(), "Models directory should exist")
13-
// assertTrue(modelsDir.listFiles()?.isNotEmpty() == true, "Models directory should contain generated files")
14-
// }
15-
//
16-
// @Test
17-
// fun `at least one model file should be generated`() {
18-
// val modelsDir = File(MODELS_DIR)
19-
// val kotlinFiles = modelsDir.listFiles { file -> file.extension == "kt" } ?: emptyArray()
20-
// assertTrue(kotlinFiles.isNotEmpty(), "Models directory should contain at least one generated .kt file")
21-
// }
22-
//
23-
// @Test
24-
// fun `all generated model files should not be empty`() {
25-
// val modelsDir = File(MODELS_DIR)
26-
// val kotlinFiles = modelsDir.walkTopDown().filter { it.isFile && it.extension == "kt" }
27-
// kotlinFiles.forEach { file ->
28-
// assertTrue(file.readText().isNotBlank(), "${file.name} should not be empty")
29-
// }
30-
// }
8+
9+
@Test
10+
fun `models directory should not be empty`() {
11+
val modelsDir = File(MODELS_DIR)
12+
assertTrue(modelsDir.exists(), "Models directory should exist")
13+
assertTrue(modelsDir.listFiles()?.isNotEmpty() == true, "Models directory should contain generated files")
14+
}
15+
16+
@Test
17+
fun `at least one model file should be generated`() {
18+
val modelsDir = File(MODELS_DIR)
19+
val kotlinFiles = modelsDir.listFiles { file -> file.extension == "kt" } ?: emptyArray()
20+
assertTrue(kotlinFiles.isNotEmpty(), "Models directory should contain at least one generated .kt file")
21+
}
22+
23+
@Test
24+
fun `all generated model files should not be empty`() {
25+
val modelsDir = File(MODELS_DIR)
26+
val kotlinFiles = modelsDir.walkTopDown().filter { it.isFile && it.extension == "kt" }
27+
kotlinFiles.forEach { file ->
28+
assertTrue(file.readText().isNotBlank(), "${file.name} should not be empty")
29+
}
30+
}
3131

3232
// @Test
3333
// fun `generated model files should compile without errors`() {

generator/src/test/kotlin/io/github/hosseinkarami_dev/near/rpc/generator/NearClientGenerationTest.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ import kotlin.test.assertEquals
99

1010
class NearClientGenerationTest {
1111

12-
// @Test
13-
// fun `client file should be generated`() {
14-
// val clientFile = File(NEAR_CLIENT_LOCATION)
15-
// assertTrue(clientFile.exists(), "NearClient.kt should be generated")
16-
// }
17-
//
18-
// @Test
19-
// fun `generated client should contain correct class name`() {
20-
// val clientFile = File(NEAR_CLIENT_LOCATION)
21-
// val content = clientFile.readText()
22-
// assertTrue("class NearClient" in content, "Generated client should contain NearClient class")
23-
// }
12+
@Test
13+
fun `client file should be generated`() {
14+
val clientFile = File(NEAR_CLIENT_LOCATION)
15+
assertTrue(clientFile.exists(), "NearClient.kt should be generated")
16+
}
17+
18+
@Test
19+
fun `generated client should contain correct class name`() {
20+
val clientFile = File(NEAR_CLIENT_LOCATION)
21+
val content = clientFile.readText()
22+
assertTrue("class NearClient" in content, "Generated client should contain NearClient class")
23+
}
2424

2525
// @Test
2626
// fun `generated client should compile without errors`() {

0 commit comments

Comments
 (0)