Exemplo n.º 1
0
 public void TestReplace_EmptyTemplateArgument()
 {
     IList<string> tokensNotFound;
     var tokeniser = new Tokeniser();
     var text = tokeniser.TryReplace(string.Empty, new Dictionary<string, string>(), out tokensNotFound);
 }
Exemplo n.º 2
0
 public void TestReplace_NullDictionaryArgument()
 {
     IList<string> tokensNotFound;
     var tokeniser = new Tokeniser();
     var text = tokeniser.TryReplace("some string", null, out tokensNotFound);
 }
Exemplo n.º 3
0
 private void TestReplace(Tokeniser tokeniser, Dictionary<string, string> dictionary, string template, string expectedResult, IList<string> expectedTokensNotFound)
 {
     IList<string> tokensNotFound;
     var text = tokeniser.TryReplace(template, dictionary, out tokensNotFound);
     Assert.AreEqual(expectedResult, text);
     Assert.AreEqual(expectedTokensNotFound.Count, tokensNotFound.Count);
     for (var i=0; i < expectedTokensNotFound.Count;i++ )
     {
         Assert.AreEqual(expectedTokensNotFound[i], tokensNotFound[i]);
     }
 }