public void GetIndexOfClosestRelevantBlock_NoPreviousBlockIsRelevant_ReturnsNegative1()
        {
            var relevantBlocks = new List <BookBlockIndices>();

            relevantBlocks.Add(new BookBlockIndices(2, 14));
            relevantBlocks.Add(new BookBlockIndices(3, 2));
            Assert.AreEqual(-1, BlockNavigatorViewModel.GetIndexOfClosestRelevantBlock(
                                relevantBlocks, new BookBlockIndices(1, 3), true, 0, relevantBlocks.Count - 1));
        }
        public void GetIndexOfClosestRelevantBlock_FollowingBlockIsRelevant_ReturnsClosestFollowingRelevantBlock()
        {
            var relevantBlocks = new List <BookBlockIndices>();

            relevantBlocks.Add(new BookBlockIndices(1, 2));
            relevantBlocks.Add(new BookBlockIndices(1, 20));
            relevantBlocks.Add(new BookBlockIndices(2, 1));
            relevantBlocks.Add(new BookBlockIndices(2, 7));
            relevantBlocks.Add(new BookBlockIndices(2, 8));
            relevantBlocks.Add(new BookBlockIndices(2, 14));
            relevantBlocks.Add(new BookBlockIndices(3, 2));
            Assert.AreEqual(2, BlockNavigatorViewModel.GetIndexOfClosestRelevantBlock(
                                relevantBlocks, new BookBlockIndices(1, 21), false, 0, relevantBlocks.Count - 1));
        }
        public void GetIndexOfClosestRelevantBlock_PreviousBlockIsRelevant_ReturnsClosestPreviousRelevantBlock()
        {
            var relevantBlocks = new List <BookBlockIndices>();

            relevantBlocks.Add(new BookBlockIndices(1, 2));
            relevantBlocks.Add(new BookBlockIndices(1, 20));
            relevantBlocks.Add(new BookBlockIndices(2, 1));
            relevantBlocks.Add(new BookBlockIndices(2, 7));
            relevantBlocks.Add(new BookBlockIndices(2, 8));
            relevantBlocks.Add(new BookBlockIndices(2, 14));
            relevantBlocks.Add(new BookBlockIndices(3, 2));
            Assert.AreEqual(4, BlockNavigatorViewModel.GetIndexOfClosestRelevantBlock(
                                relevantBlocks, new BookBlockIndices(2, 10), true, 0, relevantBlocks.Count - 1));
        }
 public void GetIndexOfClosestRelevantBlock_MinGreaterThanMax_ReturnsNegative1()
 {
     Assert.AreEqual(-1, BlockNavigatorViewModel.GetIndexOfClosestRelevantBlock(
                         new List <BookBlockIndices>(), new BookBlockIndices(1, 2), true, 1, 0));
 }