public void Item_count_works_on_add() { // setup var router = new FifoItemRouterWithCount <int>(); // execute foreach (var r in Enumerable.Range(0, 10)) { router.Route(r, 0); // verify router.Count().Should().Be(r + 1); } }
public void Item_count_works_on_remove() { // setup var router = new FifoItemRouterWithCount <int>(); foreach (var r in Enumerable.Range(0, 10)) { router.Route(r, 0); } foreach (var r in Enumerable.Range(0, 10)) { router.Remove(r); router.Count().Should().Be(10 - r - 1); } }