public void Not_added_item_cannot_be_removed() { // setup var router = new FifoItemRouter <int>(); router.Route(0, 0); // execute var result = router.Remove(1); // verify result.Should().BeFalse(); }
public void Added_item_can_be_removed() { // setup var router = new FifoItemRouter <int>(); router.Route(0, 0); // execute var result = router.Remove(0); // verify result.Should().BeTrue(); }
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)); }
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); }