public void TestAckSeqNormal() { SlidingWindow <SeqTest> window = new SlidingWindow <SeqTest>(10, () => new SeqTest()); SeqTest seqItem = window.GetNextAvailable(); Assert.AreEqual(1, window.Count); Assert.IsNotNull(seqItem); Assert.AreEqual(0, seqItem.Seq); window.AckSeq(seqItem.Seq); Assert.AreEqual(0, window.Count); seqItem = window.GetNextAvailable(); Assert.IsNotNull(seqItem); Assert.AreEqual(1, seqItem.Seq); window.AckSeq(seqItem.Seq); Assert.AreEqual(0, window.Count); window.GetNextAvailable(); window.GetNextAvailable(); window.GetNextAvailable(); seqItem = window.GetNextAvailable(); Assert.AreEqual(4, window.Count); Assert.AreEqual(5, seqItem.Seq); window.AckSeq(seqItem.Seq); Assert.AreEqual(0, window.Count); }