Exemple #1
0
            public void ShouldThrowExceptionWhenNameIsInvalid()
            {
                var document        = new XmlDocument();
                var scriptVariables = new ScriptVariables(document);

                ExceptionAssert.Throws <ArgumentException>("name", () =>
                {
                    scriptVariables.Get("invalid");
                }, "Invalid variable name: invalid");
            }
Exemple #2
0
            public void ShouldGetTheVariable()
            {
                var document = new XmlDocument();

                document.LoadXml("<test foo=\"{$foo}\"/>");

                var scriptVariables = new ScriptVariables(document);

                Assert.AreEqual(null, scriptVariables.Get("foo"));
            }
Exemple #3
0
            public void ShouldThrowExceptionWhenNameIsNull()
            {
                var document        = new XmlDocument();
                var scriptVariables = new ScriptVariables(document);

                ExceptionAssert.Throws <ArgumentNullException>("name", () =>
                {
                    scriptVariables.Get(null);
                });
            }