Ejemplo n.º 1
0
 public void matchesIgnoreCase()
 {
     CharacterReader r = new CharacterReader("One Two Three");
     Assert.IsTrue(r.MatchesIgnoreCase("O"));
     Assert.IsTrue(r.MatchesIgnoreCase("o"));
     Assert.IsTrue(r.Matches('O'));
     Assert.IsFalse(r.Matches('o'));
     Assert.IsTrue(r.MatchesIgnoreCase("One Two Three"));
     Assert.IsTrue(r.MatchesIgnoreCase("ONE two THREE"));
     Assert.IsTrue(r.MatchesIgnoreCase("One"));
     Assert.IsTrue(r.MatchesIgnoreCase("one"));
     Assert.AreEqual('O', r.Consume());
     Assert.IsFalse(r.MatchesIgnoreCase("One"));
     Assert.IsTrue(r.MatchesIgnoreCase("NE Two Three"));
     Assert.IsFalse(r.MatchesIgnoreCase("ne Two Three Four"));
     Assert.AreEqual("ne Two Three", r.ConsumeToEnd());
     Assert.IsFalse(r.MatchesIgnoreCase("ne"));
 }