36 references to new
Microsoft.Extensions.AI.Abstractions.Tests (3)
Contents\FunctionCallContentTests..cs (1)
99
AIFunctionArguments arguments =
new
()
Functions\AIFunctionArgumentsTests.cs (2)
17
var args = new
AIFunctionArguments
();
53
var args = new
AIFunctionArguments
Microsoft.Extensions.AI.Tests (33)
Functions\AIFunctionFactoryTest.cs (33)
43
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
46
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
49
AssertExtensions.EqualFunctionCallResults(3L, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
57
AssertExtensions.EqualFunctionCallResults("hello hello", await func.InvokeAsync(
new
() { ["a"] = "hello" }));
104
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
108
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
113
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
119
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
124
AssertExtensions.EqualFunctionCallResults(new int[] { 0, 1, 2, 3, 4 }, await func.InvokeAsync(
new
() { ["count"] = 5 }), JsonContext.Default.Options);
230
var result = (JsonElement?)await func.InvokeAsync(
new
()
245
AIFunctionArguments arguments =
new
() { ["myInteger"] = 42 };
305
var result = await func.InvokeAsync(
new
() { ["myInteger"] = 42 });
333
var result = (Tuple<MyFunctionTypeWithOneArg, MyArgumentType>?)await func.InvokeAsync(
new
() { Services = sp });
444
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
446
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
467
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
469
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
489
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1 });
492
result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
526
Exception e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
529
e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
()
536
var result = await f.InvokeAsync(
new
()
560
var result = await f.InvokeAsync(
new
() { Services = sp1 });
567
AIFunctionArguments args1 =
new
() { ["a"] = 42 };
568
AIFunctionArguments args2 =
new
() { ["a"] = 43 };
600
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
623
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
646
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
669
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
692
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
715
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
738
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
762
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);