Esempio n. 1
0
        public void Remove_does_remove_all_items_if_unavailable()
        {
            // setup
            var router = new FifoItemRouter <int>();

            foreach (var r in Enumerable.Range(0, 10))
            {
                router.Route(r, 0);
            }

            // execute
            var result = router.RemoveUntil(15, false);

            // verify
            result.Should().Equal(Enumerable.Range(0, 10));
        }
Esempio n. 2
0
        public void Remove_until_removes_all_items_before_this_item()
        {
            // setup
            var router = new FifoItemRouter <int>();

            foreach (var r in Enumerable.Range(0, 10))
            {
                router.Route(r, 0);
            }

            // execute
            var result = router.RemoveUntil(5);

            // verify
            result.Should().Equal(0, 1, 2, 3, 4, 5);
        }