public void SplitByCommaAndWhitespace_WithEmptyInput_ShouldReturnCorrectResult() { var errorMessagePrefix = "StringFormatService SplitByCommaAndWhitespace() method does not work properly."; // Arrange var stringFormatService = new StringFormatService(); var text = string.Empty; // Act var actualResult = stringFormatService.SplitByCommaAndWhitespace(text).Count; var expectedResult = 0; // Assert Assert.True(expectedResult == actualResult, errorMessagePrefix + " " + "Collection is not empty."); }
public void SplitByCommaAndWhitespace_WithCorrectData_ShouldReturnCorrectResult() { var errorMessagePrefix = "StringFormatService SplitByCommaAndWhitespace() method does not work properly."; // Arrange var stringFormatService = new StringFormatService(); var text = ", one, ,two,,, three ,"; // Act var actualResult = stringFormatService.SplitByCommaAndWhitespace(text); var expectedResult = new List <string>() { "one", "two", "three" }; // Assert for (int i = 0; i < actualResult.Count; i++) { Assert.True(expectedResult[i] == actualResult[i], errorMessagePrefix + " " + "Split text is not returned properly."); } }