private void AddAndTestValue(ref CClonedRowsContainer target, CExtendedCodeUnit item, int number) { Assert.IsNotNull(item); target.Add(item); List <CExtendedCodeUnit> rows = target.GetEqualRows(item); Assert.AreEqual(rows.Count, number); Assert.AreEqual(rows[number - 1], item); }
protected override void BuildClonedFragmentsList(CBaseClonedRowsMatrix ClonedRowsMatrix) { if (ClonedRowsMatrix is CClonedRowsContainer) { CClonedRowsContainer HashContainer = ClonedRowsMatrix as CClonedRowsContainer; } else { throw new NotSupportedException("Данный тип матрицы клон-строк не поддерживается. Требуется CClonedRowsContainer"); } }
public void AddTest1() { const int top_limit = 111; CClonedRowsContainer target = new CClonedRowsContainer(); for (long counter = CElementPosition.LINE_NUMBER_LOW_BOUND; counter < top_limit; ++counter) { CExtendedCodeUnit item = new CExtendedCodeUnit(new CCodeUnit(new CElementPosition(counter, 0), counter.ToString()), FileID, counter); AddAndTestValue(ref target, item, 1); } Assert.AreEqual(target.Count, top_limit - 1); }
public void AddTest2() { const int max_iteration = 111; int first_row = int.MaxValue / 2; int second_row = int.MaxValue; CClonedRowsContainer target = new CClonedRowsContainer(); for (long counter = CElementPosition.LINE_NUMBER_LOW_BOUND; counter < max_iteration; counter++) { CExtendedCodeUnit item1 = new CExtendedCodeUnit(new CCodeUnit(new CElementPosition(counter, 0), first_row.ToString()), FileID, counter);//(counter, first_row.ToString(), FileID, counter); AddAndTestValue(ref target, item1, (int)counter); CExtendedCodeUnit item2 = new CExtendedCodeUnit(new CCodeUnit(new CElementPosition(counter, 0), second_row.ToString()), FileID, counter);//(counter, second_row.ToString(), FileID, counter); AddAndTestValue(ref target, item2, (int)counter); } Assert.AreEqual(target.Count, 2); }
public CHashBucketAlgorithm() { m_ClonedRowsContainer = new CClonedRowsContainer(); }
public void CClonedRowsContainerConstructorTest() { CClonedRowsContainer target = new CClonedRowsContainer(); Assert.IsNotNull(target); }