예제 #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");
            }
예제 #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"));
            }
예제 #3
0
            public void ShouldThrowExceptionWhenNameIsNull()
            {
                var document        = new XmlDocument();
                var scriptVariables = new ScriptVariables(document);

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