Exemplo n.º 1
0
        public void ExpandNullString()
        {
            var me = new MacroExpander();

            Assert.AreEqual(null, me.Expand(null));
            return;
        } // end of function - ExpandNullString
Exemplo n.º 2
0
        public void ExpandValidString()
        {
            var context = Substitute.For <IItemContext>();
            var doc     = Substitute.For <EnvDTE.Document>();
            var name    = "TestDocument.cs";

            doc.Name.Returns(name);
            context.Document.Returns(doc);
            var    me           = new MacroExpander(context);
            string strToExpand  = "{FILENAME}|{DATE}|{YEAR}";
            var    expandedStrs = me.Expand(strToExpand).Split('|');

            Assert.AreEqual(3, expandedStrs.Length);
            Assert.AreEqual(expandedStrs[0], name);
            Assert.IsTrue(expandedStrs[1] != "{DATE}");
            Assert.AreEqual(expandedStrs[2], DateTime.Now.Year.ToString());
            return;
        } // end of function - ExpandValidString
Exemplo n.º 3
0
 private void ClearError(TextBox textBox)
 {
     errorProvider.SetError(textBox, null);
     toolTip.SetToolTip(textBox, _macroExpander.Expand(textBox.Text));
 }
Exemplo n.º 4
0
        public object Compile()
        {
            object o = _macroExp.Expand();

            return((o == null) ? o : Compile(o));
        }