public void CheckBadReplace () { Variables variables = new Variables (); variables.Add ("Key1", "Value1"); var exception = Assert.Throws<ObfuscarException>(() => { variables.Replace("$(Unreplaceable)"); }); Assert.AreEqual("Unable to replace variable: Unreplaceable", exception.Message); }
public void CheckReplace () { Variables variables = new Variables (); variables.Add ("Key1", "Value1"); string result = variables.Replace ("This: $(Key1) got replaced."); Assert.AreEqual ("This: Value1 got replaced.", result); }
public void CheckReplace() { Obfuscar.Variables variables = new Obfuscar.Variables(); variables.Add("Key1", "Value1"); string result = variables.Replace("This: $(Key1) got replaced."); Assert.AreEqual("This: Value1 got replaced.", result); }
public void CheckBadReplace() { Obfuscar.Variables variables = new Obfuscar.Variables(); variables.Add("Key1", "Value1"); TestUtils.AssertThrows(delegate { variables.Replace("$(Unreplaceable)"); }, typeof(ObfuscarException), "Unable", "replace", "Unreplaceable"); }
public static string GetAttribute( XmlReader reader, string name, Variables vars ) { return vars.Replace( GetAttribute( reader, name ) ); }
public static string GetAttribute(XmlReader reader, string name, Variables vars) { return(vars.Replace(GetAttribute(reader, name))); }