public void SetMove(RangeInt64 section, long loc) { if (section.Width == 0) { return; } if (loc == section.Min) { return; } if (loc <= section.Max) { throw new NotImplementedException("Cannot move a section earlier in the stream, within the move itself, or into the same spot"); } if (_moveRanges.Collides(section)) { throw new ArgumentException("Can not have colliding moves."); } _moveRanges.Add(section); _moves[section] = loc; _sameLocMoves.GetOrAdd(loc).Add(section); if (_moveRanges.IsEncapsulated(loc)) { throw new ArgumentException($"Cannot move to a section that is marked to be moved: {loc}"); } }
public void Collides_Empty() { var coll = new RangeCollection(); Assert.False(coll.Collides(new RangeInt64(3, 6))); }