public void ManageActivityDefinitions_InitializeEmptyLocalStorage_ShowsDefaultActivitySet()
        {
            // Arrange / Act
            _localStorage.ClearReceivedCalls();
            _localStorage.GetItemAsync <string>(Arg.Any <string>())
            .Returns(Task.FromResult(string.Empty));
            RenderedComponent <ManageActivityDefinitions> component =
                _host.AddComponent <ManageActivityDefinitions>();

            // Assert
            // Verify activity set selector is initialized to default
            Assert.That(component.Instance.ActivitySet, Is.EqualTo(DefaultSetName),
                        "ActivitySet initial value");
            // Verify activity grid has correct number of rows.
            HtmlAgilityPack.HtmlNode gridCountSpan = component.FindAll("span")
                                                     .FirstOrDefault(s => s.Attributes
                                                                     .Any(a => a.Value.Equals("grid-itemscount-caption",
                                                                                              StringComparison.OrdinalIgnoreCase)));
            Assert.That(gridCountSpan?.InnerText,
                        Is.EqualTo(_expectedActivitySets[DefaultSetName].Count.ToString()),
                        "Reported number of activities in grid");
            // Verify activity set is persisted.
            Received.InOrder(async() =>
            {
                // Empty comes from original load.
                await _localStorage.SetItemAsync(ActivitySetKey, DefaultSetName);
            });
        }
        public void RunScheduler_InitializeEmptyLocalStorage_ShowDefaultActivitySet()
        {
            // Arrange / Act
            _localStorage.ClearReceivedCalls();
            _localStorage.GetItemAsync <string>(Arg.Any <string>())
            .Returns(Task.FromResult(string.Empty));
            RenderedComponent <RunScheduler> component =
                _host.AddComponent <RunScheduler>();

            // Assert
            // Verify activity set selector is initialized to default
            Assert.That(component.Instance.ActivitySet, Is.EqualTo(DefaultSetName),
                        "ActivitySet initial value");

            // Verify activity set is persisted.
            Received.InOrder(async() =>
            {
                await _localStorage.SetItemAsync(ActivitySetKey, DefaultSetName);
            });
        }