public void EstaVacio() { var dic = new Dictionary <string, string>(); var obj = new DictionaryReplacer(); var result = obj.Replace("", dic); Assert.AreEqual("", result); }
public void EsNulo() { Dictionary <string, string> dic = null; var obj = new DictionaryReplacer(); var result = obj.Replace("", dic); Assert.AreEqual("", result); }
public void Test3() { string output = DictionaryReplacer.Replace("$temp$ here comes the name $name$", new Dictionary <string, string>() { { "temp", "temporary" }, { "name", "John Doe" } }); Assert.Equal("temporary here comes the name John Doe", output); }
public void Test2() { string output = DictionaryReplacer.Replace("$temp$", new Dictionary <string, string>() { { "temp", "temporary" } }); Assert.Equal("temporary", output); }
public void MuestraNombre() { var texto = "$nombre$"; var dic = new Dictionary <string, string>(); dic.Add("nombre", "Juan"); var obj = new DictionaryReplacer(); var result = obj.Replace(texto, dic); Assert.AreEqual("Juan", result); }
public void MuestraTextoOriginal() { var texto = "texto sin ninguna clave"; var dic = new Dictionary <string, string>(); dic.Add("nombre", "Juan"); dic.Add("edad", "27"); var obj = new DictionaryReplacer(); var result = obj.Replace(texto, dic); Assert.AreEqual(texto, result); }
public void MuestraNombreYEdad() { var texto = "$nombre$ tiene $edad$ años"; var dic = new Dictionary <string, string>(); dic.Add("nombre", "Juan"); dic.Add("edad", "27"); var obj = new DictionaryReplacer(); var result = obj.Replace(texto, dic); Assert.AreEqual("Juan tiene 27 años", result); }
public void Test1() { string output = DictionaryReplacer.Replace("", new Dictionary <string, string>()); Assert.Equal("", output); }
public void CanCreate() { replacer = new DictionaryReplacer(); Assert.NotNull(replacer); }