I have this method :
- private bool MatchedTarget(string TargetName, Paragraph paragraph, string text)
- {
- bool targetFound = false;
- if (IsHeader(paragraph)) {
- text.ToLower().Trim().Contains(TargetName.ToLower().Trim());
- targetFound = true;
- }
- return targetFound;
- }
And I have a unit test but it returned me Failed where it is supposed to return Passed.
Please let me know where I had gone wrong
- [Test]
- public void LowerCaseShouldReturnTrue()
- {
- ProcessingDocx processor = new ProcessingDocx(null);
- Paragraph para = CreateParagraphStyle("Normal");
-
- System.Type type = typeof(ProcessingDocx);
- bool result = (bool)type.GetMethod("MatchedTarget", BindingFlags.NonPublic | BindingFlags.Instance)
- .Invoke(processor, new object[] { "Annex A", para, "annex a" });
-
- Assert.True(result);
- }