예제 #1
0
        public void FormParameter_AssignToDefaultProperties()
        {
            FormParameterPoker FormParam = new FormParameterPoker();

            FormParam.FormField = "FormFieldTest";
            Assert.AreEqual("FormFieldTest", FormParam.FormField, "AssignToFormName");
        }
예제 #2
0
        public void FormParameter_Clone()
        {
            FormParameterPoker FormParam   = new FormParameterPoker("EmployeeName", TypeCode.String, "EmployeeLabel");
            FormParameter      clonedParam = (FormParameter)FormParam.DoClone();

            Assert.AreEqual("EmployeeName", clonedParam.Name, "FormParameterCloneName");
            Assert.AreEqual(TypeCode.String, clonedParam.Type, "FormParameterCloneType");
            Assert.AreEqual("EmployeeLabel", clonedParam.FormField, "FormParameterCloneFormField");
        }
예제 #3
0
        public static void EvaluateForm(Page p)
        {
            FormParameterPoker formParam = new FormParameterPoker();

            formParam.FormField    = "key";
            formParam.Type         = TypeCode.String;
            formParam.DefaultValue = "Default";
            TextBox tb = new TextBox();

            p.Form.Controls.Add(tb);
            string value = (string)formParam.DoEvaluate(HttpContext.Current, tb);

            Assert.AreEqual("Key1", value, "EvaluateSessionParameter");
        }
예제 #4
0
        public void FormParameter_DefaultProperties()
        {
            FormParameterPoker FormParam1 = new FormParameterPoker();

            Assert.AreEqual("", FormParam1.FormField, "DefaultFormField");
            FormParameterPoker FormParam2 = new FormParameterPoker("FirstName", "TextBox1");

            Assert.AreEqual("FirstName", FormParam2.Name, "OverloadContructorName1");
            Assert.AreEqual("TextBox1", FormParam2.FormField, "OverloadContructorFormField1");
            FormParameterPoker FormParam3 = new FormParameterPoker("Salary", TypeCode.UInt64, "SalaryTextBox");

            Assert.AreEqual("Salary", FormParam3.Name, "OverloadContructorName2");
            Assert.AreEqual("SalaryTextBox", FormParam3.FormField, "OverloadContructorFormField2");
            Assert.AreEqual(TypeCode.UInt64, FormParam3.Type, "OverloadContructorType");
            FormParameterPoker FormParam4 = new FormParameterPoker(FormParam3);

            Assert.AreEqual("Salary", FormParam4.Name, "OverloadContructorName2");
            Assert.AreEqual("SalaryTextBox", FormParam4.FormField, "OverloadContructorFormName2");
            Assert.AreEqual(TypeCode.UInt64, FormParam4.Type, "OverloadContructorType");
        }
예제 #5
0
		public static void EvaluateForm(Page p)
		{
			FormParameterPoker formParam = new FormParameterPoker();
			formParam.FormField = "key";
			formParam.Type = TypeCode.String;
			formParam.DefaultValue = "Default"; 
			TextBox tb = new TextBox();
			p.Form.Controls.Add(tb);			
			string value = (string)formParam.DoEvaluate(HttpContext.Current, tb);
			Assert.AreEqual("Key1", value, "EvaluateSessionParameter");
		}
예제 #6
0
		public void FormParameter_Clone ()
		{
			
			FormParameterPoker FormParam = new FormParameterPoker ("EmployeeName", TypeCode.String, "EmployeeLabel");
			FormParameter clonedParam = (FormParameter) FormParam.DoClone ();
			Assert.AreEqual ("EmployeeName", clonedParam.Name, "FormParameterCloneName");
			Assert.AreEqual (TypeCode.String, clonedParam.Type, "FormParameterCloneType");
			Assert.AreEqual ("EmployeeLabel", clonedParam.FormField, "FormParameterCloneFormField");
		}		
예제 #7
0
		public void FormParameter_AssignToDefaultProperties ()
		{
			FormParameterPoker FormParam = new FormParameterPoker ();
			FormParam.FormField = "FormFieldTest";
			Assert.AreEqual ("FormFieldTest", FormParam.FormField, "AssignToFormName");
		}
예제 #8
0
		public void FormParameter_DefaultProperties ()
		{
			FormParameterPoker FormParam1 = new FormParameterPoker ();
			Assert.AreEqual ("", FormParam1.FormField , "DefaultFormField");
			FormParameterPoker FormParam2 = new FormParameterPoker ("FirstName", "TextBox1");
			Assert.AreEqual ("FirstName", FormParam2.Name, "OverloadContructorName1");
			Assert.AreEqual ("TextBox1", FormParam2.FormField, "OverloadContructorFormField1");
			FormParameterPoker FormParam3 = new FormParameterPoker ("Salary", TypeCode.UInt64, "SalaryTextBox");
			Assert.AreEqual ("Salary", FormParam3.Name, "OverloadContructorName2");
			Assert.AreEqual ("SalaryTextBox", FormParam3.FormField, "OverloadContructorFormField2");
			Assert.AreEqual (TypeCode.UInt64, FormParam3.Type, "OverloadContructorType");
			FormParameterPoker FormParam4 = new FormParameterPoker (FormParam3);
			Assert.AreEqual ("Salary", FormParam4.Name, "OverloadContructorName2");
			Assert.AreEqual ("SalaryTextBox", FormParam4.FormField, "OverloadContructorFormName2");
			Assert.AreEqual (TypeCode.UInt64, FormParam4.Type, "OverloadContructorType");


		}