@@ -9,15 +9,15 @@ internal class FunctionDeclarationTest {
99
1010 @Test
1111 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" ) )
1717 )
18- )
1918
20- val expectedJson = """
19+ val expectedJson =
20+ """
2121 {
2222 "name": "isUserAGoat",
2323 "description": "Determine if the user is subject to teleportations.",
@@ -34,24 +34,28 @@ internal class FunctionDeclarationTest {
3434 ]
3535 }
3636 }
37- """ .trimIndent()
37+ """
38+ .trimIndent()
3839
3940 Json .encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
4041 }
4142
4243 @Test
4344 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+ )
5356
54- val expectedJson = """
57+ val expectedJson =
58+ """
5559 {
5660 "name": "isUserAGoat",
5761 "description": "Determine if the user is subject to teleportations.",
@@ -72,7 +76,8 @@ internal class FunctionDeclarationTest {
7276 ]
7377 }
7478 }
75- """ .trimIndent()
79+ """
80+ .trimIndent()
7681
7782 Json .encodeToString(functionDeclaration.toInternal()).shouldEqualJson(expectedJson)
7883 }
0 commit comments