public async Task If_AsNumericRange_PreviousBlockIsPhantom_ThenLastBlockIsNotThePhantom() { // ARRANGE // Create previous blocks using (var executionContext = CreateTaskExecutionContext()) { var startedOk = await executionContext.TryStartAsync(); if (startedOk) { var rangeBlocks = await executionContext.GetNumericRangeBlocksAsync(x => x.WithRange(1000, 2000, 2000)); foreach (var rangeBlock in rangeBlocks) { await rangeBlock.StartAsync(); await rangeBlock.CompleteAsync(); } } } _blocksHelper.InsertPhantomNumericBlock(TestConstants.ApplicationName, TestConstants.TaskName, 0, 100); // ACT INumericRangeBlock lastBlock = null; using (var executionContext = CreateTaskExecutionContext()) { var startedOk = await executionContext.TryStartAsync(); if (startedOk) { lastBlock = await executionContext.GetLastNumericRangeBlockAsync(LastBlockOrder.LastCreated); } } // ASSERT Assert.Equal(1000, (int)lastBlock.StartNumber); Assert.Equal(2000, (int)lastBlock.EndNumber); }