8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
1168
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
1181
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
1197
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<AIContent>("discriminator"));
1198
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<TextContent>("discriminator"));
1208
options.
AddAIContentType
<DerivedAIContent>("text");
1209
options.
AddAIContentType
<DerivedAIContent>("audio");
1219
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
1221
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));