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()); }
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()); }
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()); }