Exemplo n.º 1
0
        public void _1_Add_Should_overwrite_oldest_item_When_full()
        {
            OtherCircularBuffer <char> collection = new OtherCircularBuffer <char>(5);

            foreach (char c in "mindplugg")
            {
                collection.Add(c);
            }

            Assert.Equal("plugg", new string(collection.ToArray()));
        }
Exemplo n.º 2
0
        public void _1_Should_be_able_to_add_and_get_items_back()
        {
            OtherCircularBuffer <char> collection = new OtherCircularBuffer <char>(42);

            foreach (char c in "mindplugg")
            {
                collection.Add(c);
            }

            Assert.Equal("mindplugg", new string(collection.ToArray()));
        }
Exemplo n.º 3
0
        public void _1_Clear_Should_clear_items()
        {
            OtherCircularBuffer <char> collection = new OtherCircularBuffer <char>(42);

            foreach (char c in "mindplugg")
            {
                collection.Add(c);
            }

            collection.Clear();

            Assert.Equal(string.Empty, new string(collection.ToArray()));
        }