示例#1
0
        public void ShouldReturnGivenItem()
        {
            var buffer = new CircularBufferImplementation <int>(1);
            var item   = 5;

            buffer.Add(5);

            CollectionAssert.AreEquivalent(new[] { item }, buffer.GetAll().ToList());
        }
示例#2
0
        public void ShouldReturnItemsWhenExceedingBufferSize()
        {
            var buffer = new CircularBufferImplementation <int>(1);
            var item1  = 5;
            var item2  = 10;

            buffer.Add(item1);
            buffer.Add(item2);
            CollectionAssert.AreEquivalent(new[] { item2 }, buffer.GetAll().ToList());
        }