public void CheckAllRegions_AllRegions_OverallResultUnionsActionResultDicts() { _tabSwitchSettingsCheck = new TabSwitchSettingsCheck(null, _settingsNavigationChecks); var overallResult = _tabSwitchSettingsCheck.CheckAllSettings(); Assert.IsFalse(overallResult.Result); Assert.AreEqual(4, overallResult.Result.Count); Assert.Contains(RegionNoChangesNoErrors, overallResult.Result.Keys); Assert.AreEqual(overallResult.Result[RegionNoChangesNoErrors], _actionResultDictNoChangesNoErrors[RegionNoChangesNoErrors]); overallResult.Result.Remove(RegionNoChangesNoErrors); Assert.Contains(RegionWithChangesNoErrors, overallResult.Result.Keys); Assert.AreEqual(overallResult.Result[RegionWithChangesNoErrors], _actionResultDictWithChangesNoErrors[RegionWithChangesNoErrors]); overallResult.Result.Remove(RegionWithChangesNoErrors); Assert.Contains(RegionNoChangesWithErrors, overallResult.Result.Keys); Assert.AreEqual(overallResult.Result[RegionNoChangesWithErrors], _actionResultDictNoChangesWithErrors[RegionNoChangesWithErrors]); overallResult.Result.Remove(RegionNoChangesWithErrors); Assert.Contains(RegionWithChangesWithErrors, overallResult.Result.Keys); Assert.AreEqual(overallResult.Result[RegionWithChangesWithErrors], _actionResultDictWithChangesWithErrors[RegionWithChangesWithErrors]); overallResult.Result.Remove(RegionWithChangesWithErrors); Assert.IsEmpty(overallResult.Result, "Overall result contains unexcpeted ActionResultDicts"); }
public void CheckAllRegions_OneRegionWithChanges_OverallResultHasChanges() { _settingsNavigationChecks = new[] { _regionCheckWithChangesNoErrors, _regionCheckNoChangesNoErrors, _regionCheckNoChangesWithErrors }; _tabSwitchSettingsCheck = new TabSwitchSettingsCheck(null, _settingsNavigationChecks); var overallResult = _tabSwitchSettingsCheck.CheckAllSettings(); Assert.IsTrue(overallResult.SettingsHaveChanged); }
public void CheckAllRegions_RegionDuplicates_OverallReusltContainsActionResultsOnlyOnceAndRegionsOnlyOnce() { _settingsNavigationChecks = new[] { _regionCheckNoChangesWithErrors, _regionCheckNoChangesWithErrors, _regionCheckNoChangesWithErrors, _regionCheckWithChangesWithErrors, _regionCheckWithChangesWithErrors, _regionCheckWithChangesWithErrors }; _tabSwitchSettingsCheck = new TabSwitchSettingsCheck(null, _settingsNavigationChecks); var overallResult = _tabSwitchSettingsCheck.CheckAllSettings(); Assert.AreEqual(2, overallResult.Result.Count); Assert.Contains(RegionNoChangesWithErrors, overallResult.Result.Keys); var actionResult = overallResult.Result[RegionNoChangesWithErrors]; Assert.AreEqual(1, actionResult.Count); }
public void CheckAllRegions_NoRegionsWithErrors_OverallResultMergesToValidResult() { _settingsNavigationChecks = new[] { _regionCheckWithChangesNoErrors, _regionCheckNoChangesNoErrors }; _tabSwitchSettingsCheck = new TabSwitchSettingsCheck(null, _settingsNavigationChecks); var overallResult = _tabSwitchSettingsCheck.CheckAllSettings(); Assert.IsTrue(overallResult.Result); Assert.AreEqual(2, overallResult.Result.Count); Assert.Contains(RegionWithChangesNoErrors, overallResult.Result.Keys); Assert.AreEqual(overallResult.Result[RegionWithChangesNoErrors], _actionResultDictWithChangesNoErrors[RegionWithChangesNoErrors]); overallResult.Result.Remove(RegionWithChangesNoErrors); Assert.Contains(RegionNoChangesNoErrors, overallResult.Result.Keys); Assert.AreEqual(overallResult.Result[RegionNoChangesNoErrors], _actionResultDictNoChangesNoErrors[RegionNoChangesNoErrors]); overallResult.Result.Remove(RegionNoChangesNoErrors); Assert.IsEmpty(overallResult.Result, "Overall result contains unexcpeted ActionResultDicts"); }