Example #1
0
        public void GivenCircularBuffer_WhenDetectMissingById_ShouldRemove()
        {
            var items = SetupDetectItems(3);

            _testee.ItemDetected(items[0]);        // detect again first item -> circular

            _testee.ItemDetected(new TestItem(2)); // detect other object, but same ID

            _testee.Items.Count.Should().Be(2);
            _testee.CircularLinkedListConsistencyCheck();
        }
Example #2
0
 public void LongRunningTest_EndlessLoop()
 {
     for (int i = 0; i < 100; i++)
     {
         _testee = new LinkedListScanner <TestItem>();
         GiveManyItems_WhenNewDetectedWithRaceConditions_ShouldBeConsistent();
         Action act = () => _testee.CircularLinkedListConsistencyCheck();
         act.ShouldNotThrow();
     }
 }