Esempio n. 1
0
 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}");
     }
 }
Esempio n. 2
0
    public void IsEncapsulated_EmptyNegative()
    {
        var coll = new RangeCollection();

        Assert.False(coll.IsEncapsulated(-5));
    }
Esempio n. 3
0
    public void IsEncapsulated_EmptyZero()
    {
        var coll = new RangeCollection();

        Assert.False(coll.IsEncapsulated(0));
    }