@@ -9,15 +9,15 @@ internal class FunctionDeclarationTest {
9
9
10
10
@Test
11
11
fun `Basic FunctionDeclaration with name, description and parameters` () {
12
- val functionDeclaration = FunctionDeclaration (
13
- name = " isUserAGoat " ,
14
- description = " Determine if the user is subject to teleportations. " ,
15
- parameters = mapOf (
16
- " userID" to Schema .string(" ID of the User making the call" )
12
+ val functionDeclaration =
13
+ FunctionDeclaration (
14
+ name = " isUserAGoat " ,
15
+ description = " Determine if the user is subject to teleportations. " ,
16
+ parameters = mapOf ( " userID" to Schema .string(" ID of the User making the call" ) )
17
17
)
18
- )
19
18
20
- val expectedJson = """
19
+ val expectedJson =
20
+ """
21
21
{
22
22
"name": "isUserAGoat",
23
23
"description": "Determine if the user is subject to teleportations.",
@@ -34,24 +34,28 @@ internal class FunctionDeclarationTest {
34
34
]
35
35
}
36
36
}
37
- """ .trimIndent()
37
+ """
38
+ .trimIndent()
38
39
39
40
Json .encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
40
41
}
41
42
42
43
@Test
43
44
fun `FunctionDeclaration with optional parameters` () {
44
- val functionDeclaration = FunctionDeclaration (
45
- name = " isUserAGoat" ,
46
- description = " Determine if the user is subject to teleportations." ,
47
- parameters = mapOf (
48
- " userID" to Schema .string(" ID of the user making the call" ),
49
- " userName" to Schema .string(" Name of the user making the call" )
50
- ),
51
- optionalParameters = listOf (" userName" )
52
- )
45
+ val functionDeclaration =
46
+ FunctionDeclaration (
47
+ name = " isUserAGoat" ,
48
+ description = " Determine if the user is subject to teleportations." ,
49
+ parameters =
50
+ mapOf (
51
+ " userID" to Schema .string(" ID of the user making the call" ),
52
+ " userName" to Schema .string(" Name of the user making the call" )
53
+ ),
54
+ optionalParameters = listOf (" userName" )
55
+ )
53
56
54
- val expectedJson = """
57
+ val expectedJson =
58
+ """
55
59
{
56
60
"name": "isUserAGoat",
57
61
"description": "Determine if the user is subject to teleportations.",
@@ -72,7 +76,8 @@ internal class FunctionDeclarationTest {
72
76
]
73
77
}
74
78
}
75
- """ .trimIndent()
79
+ """
80
+ .trimIndent()
76
81
77
82
Json .encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
78
83
}
0 commit comments