+2005-01-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DbDataPermissionAttribute.cs, PermissionHelper.cs :
+ fixed some incompatible type of exception between 2.0 and 1.x.
+ * DataContainer.cs :
+ Wrap exceptions thrown by SetValue() within ArgumentException.
+
2004-12-10 Sureshkumar T <tsureshkumar@novell.com>
* DbDataAdapter.cs (BuildSchema): Add the primary key schema iff
SetValue(index,(short)value);
}
else {
- SetValue(index,Convert.ToInt16(value));
+ try {
+ SetValue(index,Convert.ToInt16(value));
+ } catch (Exception ex) {
+ throw new ArgumentException (ex.Message, ex);
+ }
}
SetNull(index,value == null,isDbNull);
}
set {
if (!Enum.IsDefined (typeof (KeyRestrictionBehavior), value)) {
string msg = Locale.GetText ("Unknown value.");
+#if NET_2_0
throw new ArgumentOutOfRangeException ("KeyRestrictionBehavior", value, msg);
+#else
+ throw new ArgumentException ("KeyRestrictionBehavior", msg);
+#endif
}
keyRestrictionBehavior = value;
}
break;
default:
msg = String.Format (Locale.GetText ("Invalid enum {0}"), state);
+#if NET_2_0
throw new ArgumentOutOfRangeException (msg, "state");
+#else
+ throw new ArgumentException (msg, "state");
+#endif
}
return state;
}
+2005-01-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * DBDataPermissionTest.cs, DBDataPermissionAttributeTest.cs:
+ Fixed some incompatible type of exception between 2.0 and 1.1.
+
2005-01-14 Atsushi Enomoto <atsushi@ximian.com>
* DataTableMappingCollectionTest.cs,
}\r
\r
[Test]\r
+#if NET_2_0\r
[ExpectedException (typeof (ArgumentOutOfRangeException))]\r
+#else\r
+ [ExpectedException (typeof (ArgumentException))]\r
+#endif\r
public void KeyRestrictionBehavior_Invalid ()\r
{\r
DBDataPermissionAttribute a = new NonAbstractDBDataPermissionAttribute (SecurityAction.Assert);\r
}
#endif
[Test]
+#if NET_2_0
[ExpectedException (typeof (ArgumentOutOfRangeException))]
+#else
+ [ExpectedException (typeof (ArgumentException))]
+#endif
public void Constructor_PermissionState_Invalid ()
{
PermissionState ps = (PermissionState) Int32.MinValue;
{
NonAbstractDBDataPermission empty = new NonAbstractDBDataPermission (PermissionState.None);
NonAbstractDBDataPermission union = (NonAbstractDBDataPermission) empty.Union (empty);
- Assert.IsNull (union, "Empty U Empty");
+ Assert.IsNotNull (union, "Empty U Empty");
NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.None);
dbdp1.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);
+2005-01-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * OdbcPermissionTest.cs, OdbcPermissionAttributeTest.cs:
+ Fixed some incompatible type of exception between 2.0 and 1.1.
+
2004-11-26 Sureshkumar T <tsureshkumar@novell.com>
* OdbcParameterCollectionTest.cs: New file for testing
}\r
\r
[Test]\r
+#if NET_2_0\r
[ExpectedException (typeof (ArgumentOutOfRangeException))]\r
+#else\r
+ [ExpectedException (typeof (ArgumentException))]\r
+#endif\r
public void KeyRestrictionBehavior_Invalid ()\r
{\r
OdbcPermissionAttribute a = new OdbcPermissionAttribute (SecurityAction.Assert);\r
}
[Test]
+#if NET_2_0
[ExpectedException (typeof (ArgumentOutOfRangeException))]
+#else
+ [ExpectedException (typeof (ArgumentException))]
+#endif
public void PermissionState_Invalid ()
{
PermissionState ps = (PermissionState)Int32.MinValue;
+2005-01-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * OleDbPermissionTest.cs, OleDbPermissionAttributeTest.cs:
+ Fixed some incompatible type of exception between 2.0 and 1.1.
+
2004-09-15 Sebastien Pouliot <sebastien@ximian.com>
* OleDbPermissionTest.cs: New. Unit tests for OleDbPermission.
}\r
\r
[Test]\r
+#if NET_2_0\r
[ExpectedException (typeof (ArgumentOutOfRangeException))]\r
+#else\r
+ [ExpectedException (typeof (ArgumentException))]\r
+#endif\r
public void KeyRestrictionBehavior_Invalid ()\r
{\r
OleDbPermissionAttribute a = new OleDbPermissionAttribute (SecurityAction.Assert);\r
}\r
\r
[Test]\r
+#if NET_2_0\r
[ExpectedException (typeof (ArgumentOutOfRangeException))]\r
+#else\r
+ [ExpectedException (typeof (ArgumentException))]\r
+#endif\r
public void PermissionState_Invalid ()\r
{\r
PermissionState ps = (PermissionState)Int32.MinValue;\r
+2005-01-14 Atsushi Enomoto <atsushi@ximian.com>
+
+ * SqlClientPermissionTest.cs, SqlClientPermissionAttributeTest.cs:
+ Fixed some incompatible type of exception between 2.0 and 1.1.
+
2004-11-01 Gert Driesen <drieseng@users.sourceforge.net>
* SqlCommandTest.cs: Added testcase for bug #66630.
}\r
\r
[Test]\r
+#if NET_2_0\r
[ExpectedException (typeof (ArgumentOutOfRangeException))]\r
+#else\r
+ [ExpectedException (typeof (ArgumentException))]\r
+#endif\r
public void KeyRestrictionBehavior_Invalid ()\r
{\r
SqlClientPermissionAttribute a = new SqlClientPermissionAttribute (SecurityAction.Assert);\r
}\r
\r
[Test]\r
+#if NET_2_0\r
[ExpectedException (typeof (ArgumentOutOfRangeException))]\r
+#else\r
+ [ExpectedException (typeof (ArgumentException))]\r
+#endif\r
public void PermissionState_Invalid ()\r
{\r
PermissionState ps = (PermissionState)Int32.MinValue;\r