90 instantiations of TestData
Microsoft.Extensions.AI.Abstractions.Tests (90)
test\Shared\JsonSchemaExporter\TestTypes.cs (90)
49yield return new TestData<object>( 54yield return new TestData<bool>(true, """{"type":"boolean"}"""); 55yield return new TestData<byte>(42, """{"type":"integer"}"""); 56yield return new TestData<ushort>(42, """{"type":"integer"}"""); 57yield return new TestData<uint>(42, """{"type":"integer"}"""); 58yield return new TestData<ulong>(42, """{"type":"integer"}"""); 59yield return new TestData<sbyte>(42, """{"type":"integer"}"""); 60yield return new TestData<short>(42, """{"type":"integer"}"""); 61yield return new TestData<int>(42, """{"type":"integer"}"""); 62yield return new TestData<long>(42, """{"type":"integer"}"""); 63yield return new TestData<float>(1.2f, """{"type":"number"}"""); 64yield return new TestData<double>(3.14159d, """{"type":"number"}"""); 65yield return new TestData<decimal>(3.14159M, """{"type":"number"}"""); 67yield return new TestData<UInt128>(42, """{"type":"integer"}"""); 68yield return new TestData<Int128>(42, """{"type":"integer"}"""); 71yield return new TestData<Half>((Half)3.141, """{"type":"number"}"""); 73yield return new TestData<string>("I am a string", """{"type":["string","null"]}"""); 74yield return new TestData<char>('c', """{"type":"string","minLength":1,"maxLength":1}"""); 75yield return new TestData<byte[]>( 80yield return new TestData<Memory<byte>>(new byte[] { 1, 2, 3 }, """{"type":"string"}"""); 81yield return new TestData<ReadOnlyMemory<byte>>(new byte[] { 1, 2, 3 }, """{"type":"string"}"""); 82yield return new TestData<DateTime>( 87yield return new TestData<DateTimeOffset>( 92yield return new TestData<TimeSpan>( 98yield return new TestData<DateOnly>(new(2021, 1, 1), """{"type":"string","format": "date"}"""); 99yield return new TestData<TimeOnly>(new(hour: 22, minute: 30, second: 33, millisecond: 100), """{"type":"string","format": "time"}"""); 101yield return new TestData<Guid>(Guid.Empty, """{"type":"string","format":"uuid"}"""); 102yield return new TestData<Uri>(new("http://example.com"), """{"type":["string","null"], "format":"uri"}"""); 103yield return new TestData<Version>(new(1, 2, 3, 4), """{"$comment":"Represents a version string.", "type":["string","null"],"pattern":"^\\d+(\\.\\d+){1,3}$"}"""); 104yield return new TestData<JsonDocument>(JsonDocument.Parse("""[{ "x" : 42 }]"""), "true"); 105yield return new TestData<JsonElement>(JsonDocument.Parse("""[{ "x" : 42 }]""").RootElement, "true"); 106yield return new TestData<JsonNode>(JsonNode.Parse("""[{ "x" : 42 }]"""), "true"); 107yield return new TestData<JsonValue>((JsonValue)42, "true"); 108yield return new TestData<JsonObject>(new() { ["x"] = 42 }, """{"type":["object","null"]}"""); 109yield return new TestData<JsonArray>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}"""); 112yield return new TestData<IntEnum>(IntEnum.A, """{"type":"integer"}"""); 113yield return new TestData<StringEnum>(StringEnum.A, """{"enum": ["A","B","C"]}"""); 114yield return new TestData<FlagsStringEnum>(FlagsStringEnum.A, """{"type":"string"}"""); 117yield return new TestData<bool?>(true, """{"type":["boolean","null"]}"""); 118yield return new TestData<int?>(42, """{"type":["integer","null"]}"""); 119yield return new TestData<double?>(3.14, """{"type":["number","null"]}"""); 120yield return new TestData<Guid?>(Guid.Empty, """{"type":["string","null"],"format":"uuid"}"""); 121yield return new TestData<JsonElement?>(JsonDocument.Parse("{}").RootElement, "true"); 122yield return new TestData<IntEnum?>(IntEnum.A, """{"type":["integer","null"]}"""); 123yield return new TestData<StringEnum?>(StringEnum.A, """{"enum":["A","B","C",null]}"""); 124yield return new TestData<SimpleRecordStruct?>( 139yield return new TestData<SimplePoco>( 175yield return new TestData<SimpleRecord>( 190yield return new TestData<SimpleRecordStruct>( 204yield return new TestData<RecordWithOptionalParameters>( 225yield return new TestData<PocoWithRequiredMembers>( 239yield return new TestData<PocoWithIgnoredMembers>( 249yield return new TestData<PocoWithCustomNaming>( 261yield return new TestData<PocoWithCustomNumberHandling>( 270yield return new TestData<PocoWithCustomNumberHandlingOnProperties>( 295yield return new TestData<PocoWithRecursiveMembers>( 393yield return new TestData<PocoWithDescription>( 406yield return new TestData<PocoWithCustomConverter>(new() { Value = 42 }, "true"); 407yield return new TestData<PocoWithCustomPropertyConverter>(new() { Value = 42 }, """{"type":["object","null"],"properties":{"Value":true}}"""); 408yield return new TestData<PocoWithEnums>( 444yield return new TestData<PocoWithStructFollowedByNullableStruct>( 473yield return new TestData<PocoWithNullableStructFollowedByStruct>( 502yield return new TestData<PocoWithExtensionDataProperty>( 506yield return new TestData<PocoDisallowingUnmappedMembers>( 520yield return new TestData<SimplePoco>( 538yield return new TestData<PocoWithNullableAnnotationAttributes>( 553yield return new TestData<PocoWithNullableAnnotationAttributesOnConstructorParams>( 566yield return new TestData<PocoWithNullableConstructorParameter>( 578yield return new TestData<PocoWithOptionalConstructorParams>( 598yield return new TestData<GenericPocoWithNullableConstructorParameter<string>>( 610yield return new TestData<PocoWithPolymorphism>( 666yield return new TestData<NonAbstractClassWithSingleDerivedType>( 676yield return new TestData<ClassWithOptionalObjectParameter>( 689yield return new TestData<PocoCombiningPolymorphicTypeAndDerivedTypes>( 802yield return new TestData<int[]>([1, 2, 3], """{"type":["array","null"],"items":{"type":"integer"}}"""); 803yield return new TestData<List<bool>>([false, true, false], """{"type":["array","null"],"items":{"type":"boolean"}}"""); 804yield return new TestData<HashSet<string>>(["one", "two", "three"], """{"type":["array","null"],"items":{"type":["string","null"]}}"""); 805yield return new TestData<Queue<double>>(new([1.1, 2.2, 3.3]), """{"type":["array","null"],"items":{"type":"number"}}"""); 806yield return new TestData<Stack<char>>(new(['x', '2', '+']), """{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":1}}"""); 807yield return new TestData<ImmutableArray<int>>(ImmutableArray.Create(1, 2, 3), """{"type":"array","items":{"type":"integer"}}"""); 808yield return new TestData<ImmutableList<string>>(ImmutableList.Create("one", "two", "three"), """{"type":["array","null"],"items":{"type":["string","null"]}}"""); 809yield return new TestData<ImmutableQueue<bool>>(ImmutableQueue.Create(false, false, true), """{"type":["array","null"],"items":{"type":"boolean"}}"""); 810yield return new TestData<object[]>([1, "two", 3.14], """{"type":["array","null"]}"""); 811yield return new TestData<System.Collections.ArrayList>([1, "two", 3.14], """{"type":["array","null"]}"""); 814yield return new TestData<Dictionary<string, int>>( 818yield return new TestData<StructDictionary<string, int>>( 822yield return new TestData<SortedDictionary<int, string>>( 826yield return new TestData<Dictionary<string, SimplePoco>>( 849yield return new TestData<Dictionary<string, object>>( 853yield return new TestData<Hashtable>(