24 instantiations of TestDTO
Microsoft.JSInterop.Tests (24)
Infrastructure\DotNetDispatcherTest.cs (24)
116var arg3 = new TestDTO { IntVal = 999, StringVal = "My string" }; 123new TestDTO { StringVal = "Another string", IntVal = 456 }, 156var arg3 = new TestDTO { IntVal = 999, StringVal = "My string" }; 163new TestDTO { StringVal = "Another string", IntVal = 456 }, 267var testDTO = new TestDTO { StringVal = "Hello", IntVal = 4 }; 321var testDTO = new TestDTO { StringVal = "Hello", IntVal = 4 }; 451var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" }; 582new TestDTO { StringVal = "Another string", IntVal = 456 }, 600var objectRef = DotNetObjectReference.Create(new TestDTO { IntVal = 4 }); 603new TestDTO { StringVal = "Another string", IntVal = 456 }, 624var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" }; 632new TestDTO { IntVal = 1000, StringVal = "String via JSON" }, 663var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" }; 671new TestDTO { IntVal = 1000, StringVal = "String via JSON" }, 911=> new TestDTO { StringVal = "Test", IntVal = 123 }; 915=> new TestDTO { StringVal = "Test", IntVal = 456 }; 921new TestDTO // Return via JSON marshalling 926DotNetObjectReference.Create(new TestDTO // Return by ref 939=> new TestDTO { StringVal = "InvokableMethodWithoutCustomIdentifier", IntVal = 456 }; 956DotNetObjectReference.Create(new TestDTO 971SomeDTO = new TestDTO // Return via JSON 976SomeDTORef = DotNetObjectReference.Create(new TestDTO // Return by ref 990SomeDTO = new TestDTO // Return via JSON 995SomeDTORef = DotNetObjectReference.Create(new TestDTO // Return by ref
58 references to TestDTO
Microsoft.JSInterop.Tests (58)
Infrastructure\DotNetDispatcherTest.cs (58)
91var result = JsonSerializer.Deserialize<TestDTO>(resultJson, jsRuntime.JsonSerializerOptions); 104var result = JsonSerializer.Deserialize<TestDTO>(resultJson, jsRuntime.JsonSerializerOptions); 116var arg3 = new TestDTO { IntVal = 999, StringVal = "My string" }; 134var resultDto1 = JsonSerializer.Deserialize<TestDTO>(root[0].GetRawText(), jsRuntime.JsonSerializerOptions); 141Assert.False(resultDto2Ref.TryGetProperty(nameof(TestDTO.StringVal), out _)); 142Assert.False(resultDto2Ref.TryGetProperty(nameof(TestDTO.IntVal), out _)); 145var resultDto2 = Assert.IsType<DotNetObjectReference<TestDTO>>(jsRuntime.GetObjectReference(property.GetInt64())).Value; 156var arg3 = new TestDTO { IntVal = 999, StringVal = "My string" }; 171Assert.Equal($"In call to '{method}', parameter of type '{nameof(TestDTO)}' at index 3 must be declared as type 'DotNetObjectRef<TestDTO>' to receive the incoming value.", ex.Message); 267var testDTO = new TestDTO { StringVal = "Hello", IntVal = 4 }; 268var task = jsRuntime.InvokeAsync<TestDTO>("unimportant"); 277var result = task.Result; 289var task = jsRuntime.InvokeAsync<TestDTO>("unimportant"); 305var task = jsRuntime.InvokeAsync<TestDTO>("unimportant"); 321var testDTO = new TestDTO { StringVal = "Hello", IntVal = 4 }; 326var task = jsRuntime.InvokeAsync<TestDTO>("unimportant", cts.Token); 342var task = jsRuntime.InvokeAsync<TestDTO>("somemethod"); 353var task = jsRuntime.InvokeAsync<TestDTO>("somemethod"); 364var task = jsRuntime.InvokeAsync<TestDTO>("somemethod"); 375var task = jsRuntime.InvokeAsync<TestDTO>("somemethod"); 389var task = jsRuntime.InvokeAsync<TestDTO>("unimportant", cts.Token); 405var task = jsRuntime.InvokeAsync<TestDTO>("somemethod"); 435var task = jsRuntime.InvokeAsync<TestDTO>("somemethod"); 451var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" }; 462var resultDto = ((DotNetObjectReference<TestDTO>)jsRuntime.GetObjectReference(3)).Value; 522var result = JsonSerializer.Deserialize<TestDTO>(resultJson, jsRuntime.JsonSerializerOptions); 525var result2 = JsonSerializer.Deserialize<TestDTO>(resultJson2, jsRuntime.JsonSerializerOptions); 624var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" }; 652var resultDto2 = result.SomeDTORef.Value; 663var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" }; 835var result = DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(TestDTO), }); 838var value = Assert.IsType<TestDTO>(Assert.Single(result)); 850var result = DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(int), typeof(TestDTO), }); 867var ex = Assert.Throws<InvalidOperationException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), method, arguments, new[] { typeof(int), typeof(TestDTO), })); 870Assert.Equal($"In call to '{method}', parameter of type '{nameof(TestDTO)}' at index 2 must be declared as type 'DotNetObjectRef<TestDTO>' to receive the incoming value.", ex.Message); 918public static object[] MyInvocableWithParams(TestDTO dtoViaJson, int[] incrementAmounts, DotNetObjectReference<TestDTO> dtoByRef) 934public static object[] IncorrectDotNetObjectRefUsage(TestDTO dtoViaJson, int[] incrementAmounts, TestDTO dtoByRef) 938public static TestDTO InvokableMethodWithoutCustomIdentifier() 948public object[] InvokableInstanceMethod(string someString, DotNetObjectReference<TestDTO> someDTORef) 950var someDTO = someDTORef.Value; 965public async Task<InvokableAsyncMethodResult> InvokableAsyncMethod(TestDTO dtoViaJson, DotNetObjectReference<TestDTO> dtoByRefWrapper) 968var dtoByRef = dtoByRefWrapper.Value; 985public async ValueTask<InvokableAsyncMethodResult> InvokableAsyncMethodReturningValueTask(TestDTO dtoViaJson, DotNetObjectReference<TestDTO> dtoByRefWrapper) 987var dtoByRef = dtoByRefWrapper.Value; 1012public TestDTO SomeDTO { get; set; } 1013public DotNetObjectReference<TestDTO> SomeDTORef { get; set; }