8 references to AddAIContentType
Microsoft.Extensions.AI.Abstractions.Tests (8)
Utilities\AIJsonUtilitiesTests.cs (8)
1046
options.
AddAIContentType
<DerivedAIContent>("derivativeContent");
1059
Assert.Throws<InvalidOperationException>(() => AIJsonUtilities.DefaultOptions.
AddAIContentType
<DerivedAIContent>("derivativeContent"));
1075
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<AIContent>("discriminator"));
1076
Assert.Throws<ArgumentException>("contentType", () => options.
AddAIContentType
<TextContent>("discriminator"));
1086
options.
AddAIContentType
<DerivedAIContent>("text");
1087
options.
AddAIContentType
<DerivedAIContent>("audio");
1097
Assert.Throws<ArgumentNullException>("options", () => ((JsonSerializerOptions)null!).
AddAIContentType
<DerivedAIContent>("discriminator"));
1099
Assert.Throws<ArgumentNullException>("typeDiscriminatorId", () => options.
AddAIContentType
<DerivedAIContent>(null!));