/// <summary> /// Copies the data from the clonable instance into the cloned instance ;) /// </summary> /// <param name="thisObj">The this object.</param> public void CopyTo(SBinaryDataListEntry thisObj) { // This is dangerous. We need to check for alias keys and use them instead ;) var keys = thisObj._myKeys; HashSet <int> gaps = keys.Gaps; int min = keys.MinValue; int max = keys.MaxValue; Columns = thisObj.Columns; _itemStorage = thisObj._itemStorage; // avoid referencing issues ;) _myKeys = new IndexList(gaps, max, min); DataListKey = thisObj.DataListKey; IsEmtpy = thisObj.IsEmtpy; IsRecordset = thisObj.IsRecordset; IsEvaluationScalar = thisObj.IsEvaluationScalar; Namespace = thisObj.Namespace; IsManagmentServicePayload = thisObj.IsManagmentServicePayload; _strToColIdx = thisObj._strToColIdx; _keyToAliasMap = thisObj._keyToAliasMap; }
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> /// Copies the data from the clonable instance into the cloned instance ;) /// </summary> /// <param name="thisObj">The this object.</param> public void CopyTo(SBinaryDataListEntry thisObj) { // This is dangerous. We need to check for alias keys and use them instead ;) var keys = thisObj._myKeys; HashSet<int> gaps = keys.Gaps; int min = keys.MinValue; int max = keys.MaxValue; Columns = thisObj.Columns; _itemStorage = thisObj._itemStorage; // avoid referencing issues ;) _myKeys = new IndexList(gaps, max, min); DataListKey = thisObj.DataListKey; IsEmtpy = thisObj.IsEmtpy; IsRecordset = thisObj.IsRecordset; IsEvaluationScalar = thisObj.IsEvaluationScalar; Namespace = thisObj.Namespace; IsManagmentServicePayload = thisObj.IsManagmentServicePayload; _strToColIdx = thisObj._strToColIdx; _keyToAliasMap = thisObj._keyToAliasMap; }