Exemple #1
0
        public void WhenRemovesOnlyNOde_ShouldReturnTrue()
        {
            var sut = new ChainedList <int>(new List <int> {
                1
            });

            Assert.IsFalse(sut.IsEmpty);
            Assert.IsTrue(sut.Any());

            sut.RemoveHead();

            Assert.IsTrue(sut.IsEmpty);
            Assert.IsFalse(sut.Any());
        }
Exemple #2
0
        public void WhenListNotEmpty_ShouldReturnFalse()
        {
            var sut = new ChainedList <int>(new List <int> {
                1, 2
            });

            Assert.IsFalse(sut.IsEmpty);
            Assert.IsTrue(sut.Any());

            sut.RemoveHead();

            Assert.IsFalse(sut.IsEmpty);
            Assert.IsTrue(sut.Any());
        }
Exemple #3
0
        public void WhenListEsEmpty_ShouldReturnTrue()
        {
            var sut = new ChainedList <int>();

            Assert.IsTrue(sut.IsEmpty);
            Assert.IsFalse(sut.Any());
        }