public void Render() { ActionPoker a = new ActionPoker(); StringWriter sw; ScriptTextWriter w; // test an empty action sw = new StringWriter(); w = new ScriptTextWriterPoker(sw); a.Writer = sw; a.RenderAction(w); Assert.AreEqual("<poker />", sw.ToString(), "A1"); // test with a target a.Target = "foo"; sw = new StringWriter(); w = new ScriptTextWriterPoker(sw); a.Writer = sw; a.RenderAction(w); Assert.AreEqual("<poker target=\"foo\" />", sw.ToString(), "A2"); // test with a target and id a.ID = "poker_action"; a.Target = "foo"; sw = new StringWriter(); w = new ScriptTextWriterPoker(sw); a.Writer = sw; a.RenderAction(w); Assert.AreEqual("<poker id=\"poker_action\" target=\"foo\" />", sw.ToString(), "A3"); }
public void Render() { Binding b = new Binding(); StringWriter sw = new StringWriter(); ScriptTextWriterPoker w = new ScriptTextWriterPoker(sw); b.Automatic = false; b.DataContext = "DataContext"; b.DataPath = "DataPath"; b.Direction = BindingDirection.InOut; b.ID = "ID"; b.Property = "Property"; b.PropertyKey = "PropertyKey"; b.TransformerArgument = "TransformerArgument"; b.RenderScript(w); Assert.AreEqual("<binding automatic=\"False\" dataContext=\"DataContext\" dataPath=\"DataPath\" direction=\"InOut\" id=\"ID\" property=\"Property\" propertyKey=\"PropertyKey\" transformerArgument=\"TransformerArgument\" />", sw.ToString(), "A1"); }
public void Render () { Binding b = new Binding(); StringWriter sw = new StringWriter(); ScriptTextWriterPoker w = new ScriptTextWriterPoker (sw); b.Automatic = false; b.DataContext = "DataContext"; b.DataPath = "DataPath"; b.Direction = BindingDirection.InOut; b.ID = "ID"; b.Property = "Property"; b.PropertyKey = "PropertyKey"; b.TransformerArgument = "TransformerArgument"; b.RenderScript (w); Assert.AreEqual ("<binding automatic=\"False\" dataContext=\"DataContext\" dataPath=\"DataPath\" direction=\"InOut\" id=\"ID\" property=\"Property\" propertyKey=\"PropertyKey\" transformerArgument=\"TransformerArgument\" />", sw.ToString(), "A1"); }
public void Render () { ActionPoker a = new ActionPoker (); StringWriter sw; ScriptTextWriter w; // test an empty action sw = new StringWriter(); w = new ScriptTextWriterPoker (sw); a.Writer = sw; a.RenderAction (w); Assert.AreEqual ("<poker />", sw.ToString(), "A1"); // test with a target a.Target = "foo"; sw = new StringWriter(); w = new ScriptTextWriterPoker (sw); a.Writer = sw; a.RenderAction (w); Assert.AreEqual ("<poker target=\"foo\" />", sw.ToString(), "A2"); // test with a target and id a.ID = "poker_action"; a.Target = "foo"; sw = new StringWriter(); w = new ScriptTextWriterPoker (sw); a.Writer = sw; a.RenderAction (w); Assert.AreEqual ("<poker id=\"poker_action\" target=\"foo\" />", sw.ToString(), "A3"); }