예제 #1
0
        public void ListWithOneNonZeroElementStaysTheSame()
        {
            var entry = new List <int> {
                1
            };
            var expected = new List <int> {
                1
            };

            var actual = new ListCleaner().TrimZeros(entry);

            Assert.That(!actual.Except(expected).ToList().Any());
        }
예제 #2
0
        public void KeepsMiddleZeros()
        {
            var entry = new List <int>
            {
                1, 3, 0, 0, 6, 7
            };

            var expected = new List <int>
            {
                1, 3, 0, 0, 6, 7
            };

            var actual = new ListCleaner().TrimZeros(entry);

            Assert.That(!actual.Except(expected).ToList().Any());
        }
예제 #3
0
        public void RemovesTrailingZeros()
        {
            var entry = new List <int>
            {
                1, 3, 5, 4, 6, 7, 0, 0, 0, 0, 0, 0
            };

            var expected = new List <int>
            {
                1, 3, 5, 4, 6, 7
            };

            var actual = new ListCleaner().TrimZeros(entry);

            Assert.That(!actual.Except(expected).ToList().Any());
        }