8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
304
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
317
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
333
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<AIContent>("discriminator"));
334
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<TextContent>("discriminator"));
341
options.
AddAIContentType
<DerivedAIContent>("text");
342
options.
AddAIContentType
<DerivedAIContent>("audio");
352
Assert.Throws<ArgumentNullException>(() => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
354
Assert.Throws<ArgumentNullException>(() => options.
AddAIContentType
<DerivedAIContent>(null!));