public void MergeMin_should_work_correctly() { var a = new StreamCoordinates( new[] { new StreamPosition { Partition = 0, Offset = 1 }, new StreamPosition { Partition = 1, Offset = 1 }, new StreamPosition { Partition = 2, Offset = 3 }, new StreamPosition { Partition = 3, Offset = 4 } }); var b = new StreamCoordinates( new[] { new StreamPosition { Partition = 0, Offset = 1 }, new StreamPosition { Partition = 1, Offset = 2 }, new StreamPosition { Partition = 2, Offset = 2 }, new StreamPosition { Partition = 5, Offset = 4 } }); var min = new StreamCoordinates( new[] { new StreamPosition { Partition = 0, Offset = 1 }, new StreamPosition { Partition = 1, Offset = 1 }, new StreamPosition { Partition = 2, Offset = 2 }, new StreamPosition { Partition = 3, Offset = 4 }, new StreamPosition { Partition = 5, Offset = 4 } }); a.MergeMinWith(b).Positions.Should().BeEquivalentTo(min.Positions); b.MergeMinWith(a).Positions.Should().BeEquivalentTo(min.Positions); }
private void AddFirstActiveEventCoordinates(StreamCoordinates coordinates) => FirstEventCoordinates = FirstEventCoordinates.MergeMinWith(coordinates);