public void ValidateRowLengths_ThrowsException_WhenRowNotSameLengthAsHeaders() { // Arrange var headerRowCount = 3; var rows = new List <string> { "1,2,3", "1,2" }; var expectedErrorMessage = "Header row cannot be different length than other rows. Rows which require fixing (with header row being 0): 2"; // Act // Assert var exception = Assert.Throws <ArgumentException>(() => _sut.ValidateRowLengths(rows, headerRowCount)); Assert.AreEqual(expectedErrorMessage, exception.Message); }