40 references to new
Microsoft.Extensions.AI.Abstractions.Tests (4)
Contents\FunctionCallContentTests..cs (1)
99
AIFunctionArguments arguments =
new
()
Functions\AIFunctionArgumentsTests.cs (2)
17
var args = new
AIFunctionArguments
();
53
var args = new
AIFunctionArguments
Functions\DelegatingAIFunctionTests.cs (1)
81
object? result = await actual.InvokeAsync(
new
(), CancellationToken.None);
Microsoft.Extensions.AI.Tests (36)
Functions\AIFunctionFactoryTest.cs (36)
45
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
48
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
51
AssertExtensions.EqualFunctionCallResults(3L, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
59
AssertExtensions.EqualFunctionCallResults("hello hello", await func.InvokeAsync(
new
() { ["a"] = "hello" }));
85
var result = await func.InvokeAsync(
new
()
115
var result = await func.InvokeAsync(
new
()
135
var result = await func.InvokeAsync(
new
()
169
AssertExtensions.EqualFunctionCallResults("test test", await func.InvokeAsync(
new
() { ["a"] = "test" }));
173
AssertExtensions.EqualFunctionCallResults("hello world", await func.InvokeAsync(
new
() { ["b"] = "hello", ["a"] = "world" }));
178
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
184
AssertExtensions.EqualFunctionCallResults(null, await func.InvokeAsync(
new
() { ["a"] = 1, ["b"] = 2L }));
189
AssertExtensions.EqualFunctionCallResults(new int[] { 0, 1, 2, 3, 4 }, await func.InvokeAsync(
new
() { ["count"] = 5 }), JsonContext.Default.Options);
296
var result = (JsonElement?)await func.InvokeAsync(
new
()
326
AIFunctionArguments arguments =
new
() { ["myInteger"] = 42 };
386
var result = await func.InvokeAsync(
new
() { ["myInteger"] = 42 });
414
var result = (Tuple<MyFunctionTypeWithOneArg, MyArgumentType>?)await func.InvokeAsync(
new
() { Services = sp });
525
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
527
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
548
Exception e = await Assert.ThrowsAsync<ArgumentException>("arguments.Services", () => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
550
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
570
var result = await f.InvokeAsync(
new
() { ["myInteger"] = 1 });
573
result = await f.InvokeAsync(
new
() { ["myInteger"] = 1, Services = sp });
607
Exception e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
() { ["myInteger"] = 1 }).AsTask());
610
e = await Assert.ThrowsAsync<ArgumentException>(() => f.InvokeAsync(
new
()
617
var result = await f.InvokeAsync(
new
()
641
var result = await f.InvokeAsync(
new
() { Services = sp1 });
648
AIFunctionArguments args1 =
new
() { ["a"] = 42 };
649
AIFunctionArguments args2 =
new
() { ["a"] = 43 };
681
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
704
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
727
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
750
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
773
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
796
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
819
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);
843
object? result = await f.InvokeAsync(
new
() { ["i"] = 42 }, cts.Token);