tests: add test cases

This commit is contained in:
Stevan Freeborn
2024-07-01 21:29:23 -05:00
parent ce6b1bf8dc
commit ff649cb3d1
2 changed files with 126 additions and 2 deletions
@@ -823,7 +823,51 @@ public class JsonSchemaGeneratorTestData : IEnumerable<object[]>
"family",
},
}
};
};
// string parameter type with custom name
yield return new object[]
{
Tool.CreateFromFunction(TestToolName,TestToolDescription,([FunctionParameter("Person's Name", "Name", true)]string name) => name),
new JsonObject()
{
["type"] = "object",
["properties"] = new JsonObject()
{
["Name"] = new JsonObject()
{
["type"] = "string",
["description"] = "Person's Name"
}
},
["required"] = new JsonArray()
{
"Name"
},
}
};
// string parameter with custom description
yield return new object[]
{
Tool.CreateFromFunction(TestToolName,TestToolDescription,([FunctionParameter("The name of the person.", required: true)]string name) => name),
new JsonObject()
{
["type"] = "object",
["properties"] = new JsonObject()
{
["name"] = new JsonObject()
{
["type"] = "string",
["description"] = "The name of the person."
}
},
["required"] = new JsonArray()
{
"name"
},
}
};
}
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();