8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
940
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
953
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
969
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<AIContent>("discriminator"));
970
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<TextContent>("discriminator"));
977
options.
AddAIContentType
<DerivedAIContent>("text");
978
options.
AddAIContentType
<DerivedAIContent>("audio");
988
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
990
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));