8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
491
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
504
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
520
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<AIContent>("discriminator"));
521
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<TextContent>("discriminator"));
528
options.
AddAIContentType
<DerivedAIContent>("text");
529
options.
AddAIContentType
<DerivedAIContent>("audio");
539
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
541
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));