public void ScriptControlDescriptor_AddComponentProperty () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.AddComponentProperty ("myName1", "myCompId1");
			scd.AddComponentProperty ("myName2", "myCompId2");

			string script = scd.DoGetScript ();
			Assert.AreEqual ("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
		}
Example #2
0
        public void ScriptControlDescriptor_AddElementProperty()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.AddElementProperty("myName1", "myElemId1");
            scd.AddElementProperty("myName2", "myElemId2");

            string script = scd.DoGetScript();

            Assert.AreEqual("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
        }
Example #3
0
        public void ScriptControlDescriptor_AddEvent()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.AddEvent("myName1", "myHandler1");
            scd.AddEvent("myName2", "myHandler2");

            string script = scd.DoGetScript();

            Assert.AreEqual("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
        }
		public void ScriptControlDescriptor_Defaults () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");

			Assert.AreEqual ("My.Type", scd.Type, "Type");
			Assert.AreEqual (String.Empty, scd.ID, "ID");
			Assert.AreEqual ("Element1", scd.ClientID, "ClientID");
			Assert.AreEqual ("Element1", scd.ElementID, "ElementID");

			string script = scd.DoGetScript ();
			Assert.AreEqual ("$create(My.Type, null, null, null, $get(\"Element1\"));", script);
		}
Example #5
0
        public void ScriptControlDescriptor_Defaults()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            Assert.AreEqual("My.Type", scd.Type, "Type");
            Assert.AreEqual(String.Empty, scd.ID, "ID");
            Assert.AreEqual("Element1", scd.ClientID, "ClientID");
            Assert.AreEqual("Element1", scd.ElementID, "ElementID");

            string script = scd.DoGetScript();

            Assert.AreEqual("$create(My.Type, null, null, null, $get(\"Element1\"));", script);
        }
Example #6
0
        public void ScriptControlDescriptor_AddComponentProperty()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.AddComponentProperty("myName1", "myCompId1");
            scd.AddComponentProperty("myName2", "myCompId2");

            string script = scd.DoGetScript();

#if TARGET_JVM
            Assert.AreEqual("$create(My.Type, null, null, {\"myName2\":\"myCompId2\",\"myName1\":\"myCompId1\"}, $get(\"Element1\"));", script);
#else
            Assert.AreEqual("$create(My.Type, null, null, {\"myName1\":\"myCompId1\",\"myName2\":\"myCompId2\"}, $get(\"Element1\"));", script);
#endif
        }
Example #7
0
        public void ScriptControlDescriptor_AddProperty_Null()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.AddProperty("myName1", null);
            scd.AddProperty("myName2", null);

            string script = scd.DoGetScript();

#if TARGET_JVM
            Assert.AreEqual("$create(My.Type, {\"myName2\":null,\"myName1\":null}, null, null, $get(\"Element1\"));", script);
#else
            Assert.AreEqual("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
#endif
        }
		public void ScriptControlDescriptor_AddEvent () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.AddEvent ("myName1", "myHandler1");
			scd.AddEvent ("myName2", "myHandler2");

			string script = scd.DoGetScript ();
			Assert.AreEqual ("$create(My.Type, null, {\"myName1\":myHandler1,\"myName2\":myHandler2}, null, $get(\"Element1\"));", script);
		}
		public void ScriptControlDescriptor_AddProperty_Null () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.AddProperty ("myName1", null);
			scd.AddProperty ("myName2", null);

			string script = scd.DoGetScript ();
			Assert.AreEqual ("$create(My.Type, {\"myName1\":null,\"myName2\":null}, null, null, $get(\"Element1\"));", script);
		}
		public void ScriptControlDescriptor_AddElementProperty () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.AddElementProperty ("myName1", "myElemId1");
			scd.AddElementProperty ("myName2", "myElemId2");

			string script = scd.DoGetScript ();
#if TARGET_JVM
			Assert.AreEqual ("$create(My.Type, {\"myName2\":$get(\"myElemId2\"),\"myName1\":$get(\"myElemId1\")}, null, null, $get(\"Element1\"));", script);
#else
			Assert.AreEqual ("$create(My.Type, {\"myName1\":$get(\"myElemId1\"),\"myName2\":$get(\"myElemId2\")}, null, null, $get(\"Element1\"));", script);
#endif
		}