public void UpdateSectionStateTest(bool validSection, string stateJson, string expectedJson)
        {
            // Assign
            var section = new PreSearchFilterSection
            {
                Options = validSection
                ? new List <PreSearchFilterOption>
                {
                    new PreSearchFilterOption
                    {
                        IsSelected = true,
                        Name       = nameof(PreSearchFilterOption.Name),
                        OptionKey  = nameof(PreSearchFilterOption.OptionKey)
                    }
                }
                : new List <PreSearchFilterOption>()
            };

            // Act
            var testObject = new PreSearchFilterStateManager();

            testObject.RestoreState(stateJson);
            testObject.UpdateSectionState(section);

            // Assert
            testObject.GetStateJson().Should().BeEquivalentTo(expectedJson);
        }
        public void GetSavedSectionTest(PreSearchFilterType preSearchFilter, string sectionTitle)
        {
            // Assign
            var stateJson = "{\"Sections\":[]}";
            var section   = GetPreSearchFilterSection(preSearchFilter, sectionTitle);

            // Act
            var testObject = new PreSearchFilterStateManager();

            testObject.RestoreState(stateJson);
            testObject.UpdateSectionState(section);
            var result = testObject.GetSavedSection(sectionTitle, preSearchFilter);

            // Assert
            result.Should().BeEquivalentTo(section);
        }
        public void RestoreOptionsTest(PreSearchFilterType preSearchFilter, string sectionTitle)
        {
            // Assign
            var stateJson = "{\"Sections\":[]}";
            var section   = GetPreSearchFilterSection(preSearchFilter, sectionTitle);

            SetUpFakesAndCalls(false);

            // Act
            var testObject = new PreSearchFilterStateManager();

            testObject.RestoreState(stateJson);
            testObject.UpdateSectionState(section);
            var result = testObject.RestoreOptions(section, GetFilterOptions(preSearchFilter));

            // Assert
            result.Options.First(x => x.IsSelected).OptionKey.Should().BeEquivalentTo(section.Options.First().OptionKey);
        }