61 instantiations of TestData
Microsoft.Extensions.AI.Abstractions.Tests (61)
test\Shared\JsonSchemaExporter\TestTypes.cs (61)
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"}"""); 73yield return new TestData<string>("I am a string", """{"type":["string","null"]}"""); 74yield return new TestData<char>('c', """{"type":"string","minLength":1,"maxLength":1}"""); 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"}"""); 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"]}"""); 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?>( 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>( 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}}"""); 502yield return new TestData<PocoWithExtensionDataProperty>( 506yield return new TestData<PocoDisallowingUnmappedMembers>( 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>>( 689yield return new TestData<PocoCombiningPolymorphicTypeAndDerivedTypes>( 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"}}"""); 814yield return new TestData<Dictionary<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>(