コード例 #1
0
        public void Name_InsideNaming()
        {
            Control ctrl = new FUControl();

            ctrl.ID = "parent";
            FormPoker form = new FormPoker();

            ctrl.Controls.Add(form);
            Assert.IsNull(form.ID, "ID");
            form.Name = "name";
            Assert.AreEqual(form.Name, form.UniqueID, "name and unique id");

            form.ID = "id";
            Assert.AreEqual("id", form.ID, "ID-2");
            Assert.AreEqual(form.UniqueID, form.Name, "Name-ID");

            form.Name = "name";
            Assert.AreEqual(form.Name, form.UniqueID, "UniqueID-2");

            form.ID = null;
            Assert.IsNull(form.ID, "ID-3");
            Assert.IsNotNull(form.UniqueID, "UniqueID-3");
            Assert.IsNotNull(form.Name, "Name-2");
        }
コード例 #2
0
ファイル: HtmlFormTest.cs プロジェクト: carrie901/mono
		public void Name_InsideNaming ()
		{
			Control ctrl = new FUControl ();
			ctrl.ID = "parent";
			FormPoker form = new FormPoker ();
			ctrl.Controls.Add (form);
			Assert.IsNull (form.ID, "ID");
			form.Name = "name";
			Assert.AreEqual (form.Name, form.UniqueID, "name and unique id");

			form.ID = "id";
			Assert.AreEqual ("id", form.ID, "ID-2");
			Assert.AreEqual (form.UniqueID, form.Name, "Name-ID");

			form.Name = "name";
			Assert.AreEqual (form.Name, form.UniqueID, "UniqueID-2");

			form.ID = null;
			Assert.IsNull (form.ID, "ID-3");
			Assert.IsNotNull (form.UniqueID, "UniqueID-3");
			Assert.IsNotNull (form.Name, "Name-2");
		}