Beispiel #1
0
        public void ScriptControlDescriptor_Type()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.Type = "New.Type";
            Assert.AreEqual("New.Type", scd.Type, "Type");
        }
		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);
		}
Beispiel #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);
		}
Beispiel #5
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);
        }
Beispiel #6
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);
        }
Beispiel #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
        }
Beispiel #8
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
        }
		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
		}
		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);
		}
Beispiel #11
0
        public void ScriptControlDescriptor_ID_set()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.ID = "My ID";
        }
		public void ScriptControlDescriptor_Type_exception_1 () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.Type = null;
		}
Beispiel #13
0
        public void ScriptControlDescriptor_Type_exception_2()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.Type = String.Empty;
        }
Beispiel #14
0
        public void ScriptControlDescriptor_Type_exception_1()
        {
            PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor("My.Type", "Element1");

            scd.Type = null;
        }
		public void ScriptControlDescriptor_Type_exception_2 () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.Type = String.Empty;
		}
		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_Type () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.Type = "New.Type";
			Assert.AreEqual ("New.Type", scd.Type, "Type");
		}
		public void ScriptControlDescriptor_ID_set () {
			PokerScriptControlDescriptor scd = new PokerScriptControlDescriptor ("My.Type", "Element1");
			scd.ID = "My ID";
		}