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);
		}
Exemple #3
0
        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);
        }
Exemple #4
0
        public void CheckBadReplace()
        {
            Obfuscar.Variables variables = new Obfuscar.Variables();
            variables.Add("Key1", "Value1");

            TestUtils.AssertThrows(delegate {
                variables.Replace("$(Unreplaceable)");
            }, typeof(ObfuscarException),
                                   "Unable", "replace", "Unreplaceable");
        }
Exemple #5
0
 public static string GetAttribute( XmlReader reader, string name, Variables vars )
 {
     return vars.Replace( GetAttribute( reader, name ) );
 }
Exemple #6
0
 public static string GetAttribute(XmlReader reader, string name, Variables vars)
 {
     return(vars.Replace(GetAttribute(reader, name)));
 }