8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
456
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
469
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
485
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<AIContent>("discriminator"));
486
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<TextContent>("discriminator"));
493
options.
AddAIContentType
<DerivedAIContent>("text");
494
options.
AddAIContentType
<DerivedAIContent>("audio");
504
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
506
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));