public void ParseFunctions_IgnoreCommentsAndBlankLines_ThrowsOnNullParseContext() { // Arrange ParseContext nullParseContext = null; Task next() => Task.CompletedTask; // Act ParseFunctions.IgnoreCommentsAndBlankLines(nullParseContext, next).Wait(); }
public void ParseFunctions_IgnoreCommentsAndBlankLines_ThrowsOnNullNextFunction() { // Arrange var reader = new StreamReader(new MemoryStream()); var state = new object(); var context = new ParseContext(reader, state); Func <Task> nullNextFunction = null; // Act ParseFunctions.IgnoreCommentsAndBlankLines(context, nullNextFunction).Wait(); }
public void ParseFunctions_IgnoreCommentsAndBlankLines_CallsNextForNonCommentNonWhiteSpaceValues() { // Arrange var reader = new StreamReader(new MemoryStream()); var state = new object(); var context = new ParseContext(reader, state) { Input = "Lorem ipsum" }; var numCallsMadeToNextFunction = 0; Task next() { numCallsMadeToNextFunction++; return(Task.CompletedTask); } // Act ParseFunctions.IgnoreCommentsAndBlankLines(context, next).Wait(); // Assert Assert.AreEqual(1, numCallsMadeToNextFunction); }
public void ParseFunctions_IgnoreCommentsAndBlankLines_DoesNotCallNextOnEmptyString() { // Arrange var reader = new StreamReader(new MemoryStream()); var state = new object(); var context = new ParseContext(reader, state) { Input = string.Empty }; var numCallsMadeToNextFunction = 0; Task next() { numCallsMadeToNextFunction++; return(Task.CompletedTask); } // Act ParseFunctions.IgnoreCommentsAndBlankLines(context, next).Wait(); // Assert Assert.AreEqual(0, numCallsMadeToNextFunction); }