public void TestQuestionOne() { var output = new Question1TestOutput(); using (var simpleReader = new SimpleCharacterReader()) { DeveloperImplementation.RunQuestionOne(simpleReader, output); VerifyQuestionOne(output); } }
public async Task TestQuestionOneAsync() { var output = new Question1TestOutput(); using (var simpleReader = new SimpleCharacterReader()) { await DeveloperImplementation.RunQuestionOne(simpleReader, output); VerifyQuestionOne(output); } }
protected void VerifyQuestionOne(Question1TestOutput output) { Assert.AreNotEqual( 85, output.Count, "No of results is not correct; should be 86. Have you dealt with the final word left after you broke out of your processing loop?"); Assert.AreEqual(86, output.Count, "No of results is not correct; should be 86"); VerifyResult(output, 0, "the", 18, "First element is not correct"); VerifyResult(output, 3, "it", 11, "Check case sensitivity?"); VerifyResult(output, 6, "in", 4, "The seventh element is not correct. Is your word break algorithm effective?"); VerifyResult(output, 49, "fair", 1, "Fiftieth element is not correct"); VerifyResult(output, 82, "way", 1, "Is way--in strictly a word do you think?"); VerifyResult(output, 85, "worst", 1, "Last element is not correct"); }