8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
1052
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
1065
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
1081
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<AIContent>("discriminator"));
1082
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<TextContent>("discriminator"));
1092
options.
AddAIContentType
<DerivedAIContent>("text");
1093
options.
AddAIContentType
<DerivedAIContent>("audio");
1103
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
1105
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));