16 instantiations of NestedAsyncComponent
Microsoft.AspNetCore.Components.Tests (16)
222 references to NestedAsyncComponent
Microsoft.AspNetCore.Components.Tests (222)
RendererTest.cs (222)
24private const string EventActionsName = nameof(NestedAsyncComponent.EventActions);
25private const string WhatToRenderName = nameof(NestedAsyncComponent.WhatToRender);
26private const string LogName = nameof(NestedAsyncComponent.Log);
233var component = new NestedAsyncComponent();
237var log = new ConcurrentQueue<(int id, NestedAsyncComponent.EventType @event)>();
240[EventActionsName] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
242[0] = new List<NestedAsyncComponent.ExecutionAction>
244NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInit),
245NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
246NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSet),
247NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async: true),
249[1] = new List<NestedAsyncComponent.ExecutionAction>
251NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInit),
252NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
253NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSet),
254NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async: true),
257[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
392var component = new NestedAsyncComponent();
396var log = new ConcurrentQueue<(int id, NestedAsyncComponent.EventType @event)>();
399[EventActionsName] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
401[0] = new List<NestedAsyncComponent.ExecutionAction>
403NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInit),
404NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
405NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSet),
406NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async: true),
408[1] = new List<NestedAsyncComponent.ExecutionAction>
410NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInit),
411NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInitAsyncAsync),
412NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSet),
413NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync),
416[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
436var component = new NestedAsyncComponent();
440var log = new ConcurrentQueue<(int id, NestedAsyncComponent.EventType @event)>();
443[EventActionsName] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
445[0] = new List<NestedAsyncComponent.ExecutionAction>
447NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInit),
448NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
449NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSet),
450NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async: true),
452[1] = new List<NestedAsyncComponent.ExecutionAction>
454NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInit),
455NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
456NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSet),
457NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync),
460[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
480var component = new NestedAsyncComponent();
484var log = new ConcurrentQueue<(int id, NestedAsyncComponent.EventType @event)>();
487[EventActionsName] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
489[0] = new List<NestedAsyncComponent.ExecutionAction>
491NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInit),
492NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
493NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSet),
494NestedAsyncComponent.ExecutionAction.On(0, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async: true),
496[1] = new List<NestedAsyncComponent.ExecutionAction>
498NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInit),
499NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
500NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSet),
501NestedAsyncComponent.ExecutionAction.On(1, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async:true),
503[2] = new List<NestedAsyncComponent.ExecutionAction>
505NestedAsyncComponent.ExecutionAction.On(2, NestedAsyncComponent.EventType.OnInit),
506NestedAsyncComponent.ExecutionAction.On(2, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
507NestedAsyncComponent.ExecutionAction.On(2, NestedAsyncComponent.EventType.OnParametersSet),
508NestedAsyncComponent.ExecutionAction.On(2, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async:true),
510[3] = new List<NestedAsyncComponent.ExecutionAction>
512NestedAsyncComponent.ExecutionAction.On(3, NestedAsyncComponent.EventType.OnInit),
513NestedAsyncComponent.ExecutionAction.On(3, NestedAsyncComponent.EventType.OnInitAsyncAsync, async:true),
514NestedAsyncComponent.ExecutionAction.On(3, NestedAsyncComponent.EventType.OnParametersSet),
515NestedAsyncComponent.ExecutionAction.On(3, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync, async:true),
518[WhatToRenderName] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3547var component = new NestedAsyncComponent();
3554[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3558new NestedAsyncComponent.ExecutionAction
3560Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3565[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3580var component = new NestedAsyncComponent();
3587[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3591new NestedAsyncComponent.ExecutionAction
3593Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3598[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3613var component = new NestedAsyncComponent();
3620[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3624new NestedAsyncComponent.ExecutionAction
3626Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3627EventAction = () => Task.FromException<(int, NestedAsyncComponent.EventType)>(exception),
3631[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3646var component = new NestedAsyncComponent();
3654[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3658new NestedAsyncComponent.ExecutionAction
3660Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3669[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3686var component = new NestedAsyncComponent();
3742var component = new NestedAsyncComponent();
3751[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3753[0] = Array.Empty<NestedAsyncComponent.ExecutionAction>(),
3754[1] = new List<NestedAsyncComponent.ExecutionAction>
3756new NestedAsyncComponent.ExecutionAction
3758Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3766[2] = new List<NestedAsyncComponent.ExecutionAction>
3768new NestedAsyncComponent.ExecutionAction
3770Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3779[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3801var component = new NestedAsyncComponent();
3809[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3811[0] = Array.Empty<NestedAsyncComponent.ExecutionAction>(),
3812[1] = new List<NestedAsyncComponent.ExecutionAction>
3814new NestedAsyncComponent.ExecutionAction
3816Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3823[2] = new List<NestedAsyncComponent.ExecutionAction>
3825new NestedAsyncComponent.ExecutionAction
3827Event = NestedAsyncComponent.EventType.OnInitAsyncAsync,
3835[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3855var component = new NestedAsyncComponent();
3864[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3868new NestedAsyncComponent.ExecutionAction
3870Event = NestedAsyncComponent.EventType.OnAfterRenderAsyncSync,
3879new NestedAsyncComponent.ExecutionAction
3881Event = NestedAsyncComponent.EventType.OnAfterRenderAsyncSync,
3885return Task.FromResult((1, NestedAsyncComponent.EventType.OnAfterRenderAsyncSync));
3890[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
3909var component = new NestedAsyncComponent();
3918[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
3922new NestedAsyncComponent.ExecutionAction
3924Event = NestedAsyncComponent.EventType.OnAfterRenderAsyncAsync,
3934new NestedAsyncComponent.ExecutionAction
3936Event = NestedAsyncComponent.EventType.OnAfterRenderAsyncAsync,
3941return (1, NestedAsyncComponent.EventType.OnAfterRenderAsyncAsync);
3946[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
4040var component = new NestedAsyncComponent();
4041var tcs = new TaskCompletionSource<(int, NestedAsyncComponent.EventType)>();
4048[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
4052new NestedAsyncComponent.ExecutionAction
4054Event = NestedAsyncComponent.EventType.OnAfterRenderAsyncAsync,
4059[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
4075var component = new NestedAsyncComponent();
4076var tcs = new TaskCompletionSource<(int, NestedAsyncComponent.EventType)>();
4082[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
4086new NestedAsyncComponent.ExecutionAction
4088Event = NestedAsyncComponent.EventType.OnAfterRenderAsyncAsync,
4093[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
4110var component = new NestedAsyncComponent();
4119[nameof(NestedAsyncComponent.EventActions)] = new Dictionary<int, IList<NestedAsyncComponent.ExecutionAction>>
4123new NestedAsyncComponent.ExecutionAction
4125Event = NestedAsyncComponent.EventType.OnAfterRenderAsyncSync,
4135[nameof(NestedAsyncComponent.WhatToRender)] = new Dictionary<int, Func<NestedAsyncComponent, RenderFragment>>
5645private void AssertStream(int expectedId, (int id, NestedAsyncComponent.EventType @event)[] logStream)
5648Assert.Equal((expectedId, NestedAsyncComponent.EventType.OnInit), logStream[0]);
5652e => e == (expectedId, NestedAsyncComponent.EventType.OnInitAsyncAsync) || e == (expectedId, NestedAsyncComponent.EventType.OnInitAsyncSync));
5654var parametersSetEvent = logStream.Where(le => le == (expectedId, NestedAsyncComponent.EventType.OnParametersSet)).ToArray();
5659.Where(le => le == (expectedId, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync) ||
5660le == (expectedId, NestedAsyncComponent.EventType.OnParametersSetAsyncSync))
5669Assert.True(logStream.Last() == (expectedId, NestedAsyncComponent.EventType.OnParametersSetAsyncSync) ||
5670logStream.Last() == (expectedId, NestedAsyncComponent.EventType.OnParametersSetAsyncAsync));
5673private Func<NestedAsyncComponent, RenderFragment> CreateRenderFactory(int[] childrenToRender)
5676var eventActionsName = nameof(NestedAsyncComponent.EventActions);
5677var whatToRenderName = nameof(NestedAsyncComponent.WhatToRender);
5678var testIdName = nameof(NestedAsyncComponent.TestId);
5679var logName = nameof(NestedAsyncComponent.Log);
5687builder.OpenComponent<NestedAsyncComponent>(2);
5703[Parameter] public IDictionary<int, Func<NestedAsyncComponent, RenderFragment>> WhatToRender { get; set; }