8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
468
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
481
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
497
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<AIContent>("discriminator"));
498
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<TextContent>("discriminator"));
505
options.
AddAIContentType
<DerivedAIContent>("text");
506
options.
AddAIContentType
<DerivedAIContent>("audio");
516
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
518
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));