23 instantiations of TestDTO
Microsoft.JSInterop.Tests (23)
Infrastructure\DotNetDispatcherTest.cs (23)
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" };
546new TestDTO { StringVal = "Another string", IntVal = 456 },
564var objectRef = DotNetObjectReference.Create(new TestDTO { IntVal = 4 });
567new TestDTO { StringVal = "Another string", IntVal = 456 },
588var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" };
596new TestDTO { IntVal = 1000, StringVal = "String via JSON" },
627var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" };
635new TestDTO { IntVal = 1000, StringVal = "String via JSON" },
875=> new TestDTO { StringVal = "Test", IntVal = 123 };
881new TestDTO // Return via JSON marshalling
886DotNetObjectReference.Create(new TestDTO // Return by ref
899=> new TestDTO { StringVal = "InvokableMethodWithoutCustomIdentifier", IntVal = 456 };
916DotNetObjectReference.Create(new TestDTO
931SomeDTO = new TestDTO // Return via JSON
936SomeDTORef = DotNetObjectReference.Create(new TestDTO // Return by ref
950SomeDTO = new TestDTO // Return via JSON
955SomeDTORef = DotNetObjectReference.Create(new TestDTO // Return by ref
54 references to TestDTO
Microsoft.JSInterop.Tests (54)
Infrastructure\DotNetDispatcherTest.cs (54)
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;
588var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" };
616var resultDto2 = result.SomeDTORef.Value;
627var arg2 = new TestDTO { IntVal = 1234, StringVal = "My string" };
799var result = DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(TestDTO), });
802var value = Assert.IsType<TestDTO>(Assert.Single(result));
814var result = DotNetDispatcher.ParseArguments(new TestJSRuntime(), "SomeMethod", arguments, new[] { typeof(int), typeof(TestDTO), });
831var ex = Assert.Throws<InvalidOperationException>(() => DotNetDispatcher.ParseArguments(new TestJSRuntime(), method, arguments, new[] { typeof(int), typeof(TestDTO), }));
834Assert.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);
878public static object[] MyInvocableWithParams(TestDTO dtoViaJson, int[] incrementAmounts, DotNetObjectReference<TestDTO> dtoByRef)
894public static object[] IncorrectDotNetObjectRefUsage(TestDTO dtoViaJson, int[] incrementAmounts, TestDTO dtoByRef)
898public static TestDTO InvokableMethodWithoutCustomIdentifier()
908public object[] InvokableInstanceMethod(string someString, DotNetObjectReference<TestDTO> someDTORef)
910var someDTO = someDTORef.Value;
925public async Task<InvokableAsyncMethodResult> InvokableAsyncMethod(TestDTO dtoViaJson, DotNetObjectReference<TestDTO> dtoByRefWrapper)
928var dtoByRef = dtoByRefWrapper.Value;
945public async ValueTask<InvokableAsyncMethodResult> InvokableAsyncMethodReturningValueTask(TestDTO dtoViaJson, DotNetObjectReference<TestDTO> dtoByRefWrapper)
947var dtoByRef = dtoByRefWrapper.Value;
972public TestDTO SomeDTO { get; set; }
973public DotNetObjectReference<TestDTO> SomeDTORef { get; set; }