public void Parameter_ConvertEmptyStringToNull () { ParameterPoker param = new ParameterPoker ("ID", TypeCode.String, "1001"); param.ConvertEmptyStringToNull = false; }
public void Parameter_DoSetDirty () { ParameterPoker param = new ParameterPoker ("ID", TypeCode.String, "1001"); object state = param.SaveState (); Assert.AreEqual (null, state, "BeforeSetDirtyMethod"); param.DoSetDirty (); state = param.SaveState (); Assert.IsTrue (null != state, "AfterSetDirtyMethod1"); }
public static void Evaluate (Page p) { ParameterPoker param = new ParameterPoker ("ID", TypeCode.String, "1001"); TextBox tb = new TextBox (); p.Controls.Add (tb); Object eval = param.DoEvaluate (HttpContext.Current, tb); //The default Evaluate method returns null in all cases Assert.AreEqual (null, eval, "ParameterEvaluate"); }
public void Parameter_AssignToDefaultProperties() { ParameterPoker param = new ParameterPoker(); param.ConvertEmptyStringToNull = false; Assert.AreEqual(false, param.ConvertEmptyStringToNull, "ConvertEmptyStringToNull"); param.DefaultValue = "LName"; Assert.AreEqual("LName", param.DefaultValue, "DefaultValue"); param.Direction = ParameterDirection.InputOutput; Assert.AreEqual(ParameterDirection.InputOutput, param.Direction, "DirectionInputOutput"); param.Direction = ParameterDirection.Output; Assert.AreEqual(ParameterDirection.Output, param.Direction, "DirectionOutput"); param.Direction = ParameterDirection.ReturnValue; Assert.AreEqual(ParameterDirection.ReturnValue, param.Direction, "DirectionReturnValue"); param.Name = "paramName"; Assert.AreEqual("paramName", param.Name, "Name"); param.Size = 10; Assert.AreEqual(10, param.Size, "Size"); param.Type = TypeCode.Boolean; Assert.AreEqual(TypeCode.Boolean, param.Type, "BooleanType"); param.Type = TypeCode.Byte; Assert.AreEqual(TypeCode.Byte, param.Type, "ByteType"); param.Type = TypeCode.Char; Assert.AreEqual(TypeCode.Char, param.Type, "CharType"); param.Type = TypeCode.DateTime; Assert.AreEqual(TypeCode.DateTime, param.Type, "DateTimeType"); param.Type = TypeCode.DBNull; Assert.AreEqual(TypeCode.DBNull, param.Type, "DBNullType"); param.Type = TypeCode.Decimal; Assert.AreEqual(TypeCode.Decimal, param.Type, "DecimalType"); param.Type = TypeCode.Double; Assert.AreEqual(TypeCode.Double, param.Type, "DoubleType"); param.Type = TypeCode.Int16; Assert.AreEqual(TypeCode.Int16, param.Type, "Int16Type"); param.Type = TypeCode.Int32; Assert.AreEqual(TypeCode.Int32, param.Type, "Int32Type"); param.Type = TypeCode.Int64; Assert.AreEqual(TypeCode.Int64, param.Type, "Int64Type"); param.Type = TypeCode.Object; Assert.AreEqual(TypeCode.Object, param.Type, "ObjectType"); param.Type = TypeCode.SByte; Assert.AreEqual(TypeCode.SByte, param.Type, "SByteType"); param.Type = TypeCode.Single; Assert.AreEqual(TypeCode.Single, param.Type, "SingleType"); param.Type = TypeCode.String; Assert.AreEqual(TypeCode.String, param.Type, "StringType"); param.Type = TypeCode.UInt16; Assert.AreEqual(TypeCode.UInt16, param.Type, "UInt16Type"); param.Type = TypeCode.UInt32; Assert.AreEqual(TypeCode.UInt32, param.Type, "UInt32Type"); param.Type = TypeCode.UInt64; Assert.AreEqual(TypeCode.UInt64, param.Type, "UInt64Type"); Assert.AreEqual(6, param.StateBag.Count, "ViewStateCount"); }
public void Parameter_Clone () { ParameterPoker param = new ParameterPoker ("ID", TypeCode.String, "1001"); param.Size = 10; param.Direction = ParameterDirection.Output; Parameter p = param.DoClone (); Assert.AreEqual ("ID", p.Name, "Clone1"); Assert.AreEqual (TypeCode.String, p.Type, "Clone2"); Assert.AreEqual ("1001", p.DefaultValue, "Clone3"); Assert.AreEqual (10, param.Size, "Clone4"); Assert.AreEqual (ParameterDirection.Output, param.Direction, "Clone5"); }
public void Parameter_DefaultProperties() { ParameterPoker param = new ParameterPoker(); Assert.AreEqual(0, param.StateBag.Count, "ViewState.Count"); Assert.AreEqual(true, param.ConvertEmptyStringToNull, "ConvertEmptyStringToNull"); Assert.AreEqual(null, param.DefaultValue, "DefaultValue"); Assert.AreEqual(ParameterDirection.Input, param.Direction, "Direction"); Assert.AreEqual("", param.Name, "Name"); Assert.AreEqual(0, param.Size, "Size"); Assert.AreEqual(TypeCode.Empty, param.Type, "Type"); }
public void Parameter_ViewState () { ParameterPoker param = new ParameterPoker ("ID", TypeCode.String, "1001"); ParameterPoker copy = new ParameterPoker (); param.Size = 100; param.Direction = ParameterDirection.InputOutput; param.DoSetDirty (); object state = param.SaveState (); copy.LoadState (state); Assert.AreEqual ("1001", copy.DefaultValue, "DefaultValue"); Assert.AreEqual (ParameterDirection.InputOutput, copy.Direction, "Direction"); Assert.AreEqual (100, copy.Size, "Size"); Assert.AreEqual (TypeCode.String, copy.Type, "Type"); Assert.AreEqual ("ID", copy.Name, "Name"); }
public void Parameter_ToString () { ParameterPoker param = new ParameterPoker ("ID",TypeCode.String ,"1001"); Assert.AreEqual ("ID", param.ToString (), "ToString"); }
public void Parameter_DefaultProtectedProperties () { ParameterPoker param = new ParameterPoker (); Assert.AreEqual (true, param.IsTrackingViewStatePoker, "IsTrackingViewState"); }
public void Parameter_AssignToDefaultProperties () { ParameterPoker param = new ParameterPoker (); param.ConvertEmptyStringToNull = false; Assert.AreEqual (false, param.ConvertEmptyStringToNull, "ConvertEmptyStringToNull"); param.DefaultValue = "LName"; Assert.AreEqual ("LName", param.DefaultValue, "DefaultValue"); param.Direction = ParameterDirection.InputOutput; Assert.AreEqual (ParameterDirection.InputOutput, param.Direction, "DirectionInputOutput"); param.Direction = ParameterDirection.Output; Assert.AreEqual (ParameterDirection.Output, param.Direction, "DirectionOutput"); param.Direction = ParameterDirection.ReturnValue; Assert.AreEqual (ParameterDirection.ReturnValue, param.Direction, "DirectionReturnValue"); param.Name = "paramName"; Assert.AreEqual ("paramName", param.Name, "Name"); param.Size = 10; Assert.AreEqual (10, param.Size, "Size"); param.Type = TypeCode.Boolean; Assert.AreEqual (TypeCode.Boolean, param.Type, "BooleanType"); param.Type = TypeCode.Byte; Assert.AreEqual (TypeCode.Byte, param.Type, "ByteType"); param.Type = TypeCode.Char ; Assert.AreEqual (TypeCode.Char, param.Type, "CharType"); param.Type = TypeCode.DateTime ; Assert.AreEqual (TypeCode.DateTime, param.Type, "DateTimeType"); param.Type = TypeCode.DBNull ; Assert.AreEqual (TypeCode.DBNull, param.Type, "DBNullType"); param.Type = TypeCode.Decimal; Assert.AreEqual (TypeCode.Decimal, param.Type, "DecimalType"); param.Type = TypeCode.Double; Assert.AreEqual (TypeCode.Double, param.Type, "DoubleType"); param.Type = TypeCode.Int16; Assert.AreEqual (TypeCode.Int16, param.Type, "Int16Type"); param.Type = TypeCode.Int32; Assert.AreEqual (TypeCode.Int32, param.Type, "Int32Type"); param.Type = TypeCode.Int64; Assert.AreEqual (TypeCode.Int64, param.Type, "Int64Type"); param.Type = TypeCode.Object; Assert.AreEqual (TypeCode.Object, param.Type, "ObjectType"); param.Type = TypeCode.SByte ; Assert.AreEqual (TypeCode.SByte, param.Type, "SByteType"); param.Type = TypeCode.Single; Assert.AreEqual (TypeCode.Single, param.Type, "SingleType"); param.Type = TypeCode.String; Assert.AreEqual (TypeCode.String, param.Type, "StringType"); param.Type = TypeCode.UInt16; Assert.AreEqual (TypeCode.UInt16, param.Type, "UInt16Type"); param.Type = TypeCode.UInt32; Assert.AreEqual (TypeCode.UInt32, param.Type, "UInt32Type"); param.Type = TypeCode.UInt64; Assert.AreEqual (TypeCode.UInt64, param.Type, "UInt64Type"); Assert.AreEqual (6, param.StateBag.Count, "ViewStateCount"); }
public void Parameter_ToString() { ParameterPoker param = new ParameterPoker("ID", TypeCode.String, "1001"); Assert.AreEqual("ID", param.ToString(), "ToString"); }
public void Parameter_DefaultProtectedProperties() { ParameterPoker param = new ParameterPoker(); Assert.AreEqual(true, param.IsTrackingViewStatePoker, "IsTrackingViewState"); }
public void Parameter_DefaultProperties () { ParameterPoker param = new ParameterPoker (); Assert.AreEqual (0, param.StateBag.Count, "ViewState.Count"); Assert.AreEqual (true, param.ConvertEmptyStringToNull, "ConvertEmptyStringToNull"); Assert.AreEqual (null, param.DefaultValue, "DefaultValue"); Assert.AreEqual (ParameterDirection.Input,param.Direction,"Direction"); Assert.AreEqual ("", param.Name, "Name"); Assert.AreEqual (0, param.Size, "Size"); Assert.AreEqual (TypeCode.Empty, param.Type, "Type"); }