Esempio n. 1
0
		public void Properties ()
		{
			DragDropList b = new DragDropList ();

			// default
			Assert.AreEqual ("dragDropList", b.TagName, "A1");
			Assert.AreEqual (null, b.AcceptedDataTypes, "A2");
			Assert.AreEqual (null, b.DataType, "A3");
			Assert.AreEqual (RepeatDirection.Vertical, b.Direction, "A4");
			Assert.AreEqual (DragMode.Copy, b.DragMode, "A5");
			Assert.AreEqual (null, b.FloatContainerCssClass, "A6");
			Assert.AreEqual (HtmlTextWriterTag.Div, b.FloatContainerTag, "A7");

			// getter/setter
			b.AcceptedDataTypes = "foo";
			Assert.AreEqual ("foo", b.AcceptedDataTypes, "A8");
			b.DataType = "DataType";
			Assert.AreEqual ("DataType", b.DataType, "A9");
			b.Direction = RepeatDirection.Vertical;
			Assert.AreEqual (RepeatDirection.Vertical, b.Direction, "A10");
			b.FloatContainerCssClass = "cssclass";
			Assert.AreEqual ("cssclass", b.FloatContainerCssClass, "A11");
			b.FloatContainerTag = HtmlTextWriterTag.Span;
			Assert.AreEqual (HtmlTextWriterTag.Span, b.FloatContainerTag, "A12");

			// null setter
			b.AcceptedDataTypes = null;
			Assert.AreEqual (null, b.AcceptedDataTypes, "A13");
			b.DataType = null;
			Assert.AreEqual (null, b.DataType, "A14");
			b.FloatContainerCssClass = null;
			Assert.AreEqual (null, b.FloatContainerCssClass, "A15");
		}
Esempio n. 2
0
		public void Render ()
		{
			DragDropList b = new DragDropList ();
			StringWriter sw;
			ScriptTextWriter w;

			sw = new StringWriter();
			w = new ScriptTextWriter (sw);
			((IScriptComponent)b).RenderScript (w);

			Assert.AreEqual ("", sw.ToString(), "A1");
		}
Esempio n. 3
0
		public void IsTypeDescriptorClosed ()
		{
			DragDropList a = new DragDropList();
			ScriptTypeDescriptor desc = ((IScriptObject)a).GetTypeDescriptor ();

			desc.AddEvent (new ScriptEventDescriptor ("testEvent", true));
		}
Esempio n. 4
0
		public void TypeDescriptor ()
		{
			DragDropList a = new DragDropList();
			ScriptTypeDescriptor desc = ((IScriptObject)a).GetTypeDescriptor ();

			Assert.AreEqual (a, desc.ScriptObject, "A1");

			// events
			IEnumerable<ScriptEventDescriptor> events = desc.GetEvents();
			Assert.IsNotNull (events, "A2");

			IEnumerator<ScriptEventDescriptor> ee = events.GetEnumerator();
			Assert.IsTrue (ee.MoveNext(), "A3");
			DoEvent (ee.Current, "propertyChanged", true);
			Assert.IsFalse (ee.MoveNext(), "A4");

			// methods
			IEnumerable<ScriptMethodDescriptor> methods = desc.GetMethods();
			Assert.IsNotNull (methods, "A5");

			IEnumerator<ScriptMethodDescriptor> me = methods.GetEnumerator();
			Assert.IsFalse (me.MoveNext ());

			// properties
			IEnumerable<ScriptPropertyDescriptor> props = desc.GetProperties();
			Assert.IsNotNull (props, "A6");

			IEnumerator<ScriptPropertyDescriptor> pe = props.GetEnumerator();
			Assert.IsTrue (pe.MoveNext(), "A7");
			DoProperty (pe.Current, "bindings", ScriptType.Array, true, "Bindings");
			Assert.IsTrue (pe.MoveNext(), "A8");
			DoProperty (pe.Current, "dataContext", ScriptType.Object, false, "");
			Assert.IsTrue (pe.MoveNext(), "A9");
			DoProperty (pe.Current, "id", ScriptType.String, false, "ID");
			Assert.IsTrue (pe.MoveNext(), "A9");
			DoProperty (pe.Current, "acceptedDataTypes", ScriptType.Array, false, "AcceptedDataTypes");
			Assert.IsTrue (pe.MoveNext(), "A10");
			DoProperty (pe.Current, "dataType", ScriptType.String, false, "DataType");
			Assert.IsTrue (pe.MoveNext(), "A11");
			DoProperty (pe.Current, "dragMode", ScriptType.Enum, false, "DragMode");
			Assert.IsTrue (pe.MoveNext(), "A12");
			DoProperty (pe.Current, "direction", ScriptType.Enum, false, "Direction");
			Assert.IsTrue (pe.MoveNext(), "A12");
			DoProperty (pe.Current, "dropCueTemplate", ScriptType.Object, false, "");
			Assert.IsTrue (pe.MoveNext(), "A13");
			DoProperty (pe.Current, "emptyTemplate", ScriptType.Object, false, "");
			Assert.IsTrue (pe.MoveNext(), "A14");
			DoProperty (pe.Current, "floatContainerTemplate", ScriptType.Object, false, "");
			Assert.IsFalse (pe.MoveNext(), "A15");
		}