Exemple #1
0
        public void Get_AddAndGetSomeNumbersShouldWork()
        {
            // Arrange
            RingBufferLinkedList <int> sut = new RingBufferLinkedList <int>(5);
            int expected = 42;

            // Act
            sut.Add(12);
            sut.Add(15);
            sut.Add(42);
            sut.Get();
            sut.Add(48);
            sut.Get();
            int actual = sut.Get();

            // Assert
            Assert.Equal(expected, actual);
        }
Exemple #2
0
        public void Get_GetNumbersFromEmptyRingBufferShouldThrowExeption()
        {
            // Arrange
            RingBufferLinkedList <int> sut = new RingBufferLinkedList <int>(5);

            // Act

            // Assert
            Assert.Throws <DataStructureIsEmptyOnReadExeption>(() => sut.Get());
        }