8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
370
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
383
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
399
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<AIContent>("discriminator"));
400
Assert.Throws<ArgumentException>(() => options.
AddAIContentType
<TextContent>("discriminator"));
407
options.
AddAIContentType
<DerivedAIContent>("text");
408
options.
AddAIContentType
<DerivedAIContent>("audio");
418
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
420
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));