public void ShouldThrowExceptionWhenNameIsInvalid() { var document = new XmlDocument(); var scriptVariables = new ScriptVariables(document); ExceptionAssert.Throws <ArgumentException>("name", () => { scriptVariables.Get("invalid"); }, "Invalid variable name: invalid"); }
public void ShouldGetTheVariable() { var document = new XmlDocument(); document.LoadXml("<test foo=\"{$foo}\"/>"); var scriptVariables = new ScriptVariables(document); Assert.AreEqual(null, scriptVariables.Get("foo")); }
public void ShouldThrowExceptionWhenNameIsNull() { var document = new XmlDocument(); var scriptVariables = new ScriptVariables(document); ExceptionAssert.Throws <ArgumentNullException>("name", () => { scriptVariables.Get(null); }); }