public void SBinaryDataListEntry_MoveIndexDataForClone_MinMaxAndGapsMove_SameDataBothSides() { //------------Setup for test-------------------------- var sBinaryDataListEntry = new SBinaryDataListEntry(); sBinaryDataListEntry.Init(1); sBinaryDataListEntry.ReInstateMinValue(2); sBinaryDataListEntry.ReInstateMaxValue(5); sBinaryDataListEntry.AddGap(1); var targetEntry = new SBinaryDataListEntry(); targetEntry.Init(1); //------------Execute Test--------------------------- targetEntry.MoveIndexDataForClone(sBinaryDataListEntry.Keys.MinIndex(), sBinaryDataListEntry.Keys.MaxIndex(), sBinaryDataListEntry.FetchGaps()); //------------Assert Results------------------------- var targetKeys = targetEntry.Keys; var parentKeys = sBinaryDataListEntry.Keys; var targetMin = targetKeys.MinIndex(); var targetMax = targetKeys.MaxIndex(); var targetCount = targetKeys.Count; var parentMin = parentKeys.MinIndex(); var parentMax = parentKeys.MaxIndex(); var parentCount = parentKeys.Count; // found count we can tell if gaps moved ;) Assert.AreEqual(3, parentCount); Assert.AreEqual(parentCount, targetCount); Assert.AreEqual(parentMin, targetMin); Assert.AreEqual(parentMax, targetMax); }
/// <summary> /// Adjusts the index view. /// </summary> /// <param name="gaps">The gaps.</param> /// <param name="min">The minimum.</param> /// <param name="max">The maximum.</param> /// <param name="onMasterEntry">if set to <c>true</c> [configuration master entry].</param> public void AdjustIndexView(HashSet <int> gaps, int min, int max, bool onMasterEntry = false) { _internalObj.MoveIndexDataForClone(min, max, gaps, onMasterEntry); }