Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -66,10 +66,8 @@ namespace MonoTests.System.Data.Common
Assert.AreEqual (String.Empty, a.ConnectionString, "ConnectionString");
Assert.AreEqual (KeyRestrictionBehavior.AllowOnly, a.KeyRestrictionBehavior, "KeyRestrictionBehavior");
Assert.AreEqual (String.Empty, a.KeyRestrictions, "KeyRestrictions");
#if NET_2_0
Assert.IsFalse (a.ShouldSerializeConnectionString (), "ShouldSerializeConnectionString");
Assert.IsFalse (a.ShouldSerializeKeyRestrictions (), "ShouldSerializeConnectionString");
#endif
}
[Test]
@@ -142,7 +140,6 @@ namespace MonoTests.System.Data.Common
try {
a.KeyRestrictionBehavior = (KeyRestrictionBehavior) 666;
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentOutOfRangeException ex) {
// The KeyRestrictionBehavior enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
@@ -153,17 +150,6 @@ namespace MonoTests.System.Data.Common
Assert.IsNotNull (ex.ParamName, "#7");
Assert.AreEqual ("KeyRestrictionBehavior", ex.ParamName, "#8");
}
#else
} catch (ArgumentException ex) {
// The KeyRestrictionBehavior enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
//Assert.IsTrue (ex.Message.IndexOf ("KeyRestrictionBehavior") != -1, "#5");
//Assert.IsTrue (ex.Message.IndexOf ("666") != -1, "#6");
//Assert.IsNull (ex.ParamName, "#7");
}
#endif
}
[Test]

View File

@@ -37,24 +37,11 @@ namespace MonoTests.System.Data.Common {
public class NonAbstractDBDataPermission : DBDataPermission {
#if !NET_2_0
public NonAbstractDBDataPermission ()
: base ()
{
}
public NonAbstractDBDataPermission (DBDataPermission permission, bool allowBlankPassword)
: base (permission)
{
AllowBlankPassword = allowBlankPassword;
}
#else
// make Copy and CreateInstance work :)
public NonAbstractDBDataPermission ()
: base (PermissionState.None)
{
}
#endif
public NonAbstractDBDataPermission (PermissionState state)
: base (state)
{
@@ -152,11 +139,7 @@ namespace MonoTests.System.Data.Common {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentOutOfRangeException))]
#else
[ExpectedException (typeof (ArgumentException))]
#endif
public void Constructor_PermissionState_Invalid ()
{
PermissionState ps = (PermissionState) Int32.MinValue;
@@ -517,7 +500,7 @@ namespace MonoTests.System.Data.Common {
{
NonAbstractDBDataPermission empty = new NonAbstractDBDataPermission (PermissionState.None);
NonAbstractDBDataPermission union = (NonAbstractDBDataPermission) empty.Union (empty);
Assert.IsNotNull (union, "Empty U Empty");
Assert.IsNull (union, "Empty U Empty");
NonAbstractDBDataPermission dbdp1 = new NonAbstractDBDataPermission (PermissionState.None);
dbdp1.Add (defaultConnectString, String.Empty, KeyRestrictionBehavior.AllowOnly);

View File

@@ -51,7 +51,6 @@ namespace MonoTests.System.Data.Common
Assert.IsTrue (da.AcceptChangesDuringFill, "#3");
}
#if NET_2_0
[Test]
public void AcceptChangesDuringUpdate ()
{
@@ -63,7 +62,6 @@ namespace MonoTests.System.Data.Common
da.AcceptChangesDuringUpdate = true;
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#3");
}
#endif
[Test]
public void ContinueUpdateOnError ()
@@ -77,7 +75,6 @@ namespace MonoTests.System.Data.Common
Assert.IsTrue (da.ContinueUpdateOnError, "#3");
}
#if NET_2_0
[Test]
public void Fill_Direct ()
{
@@ -124,7 +121,6 @@ namespace MonoTests.System.Data.Common
Assert.AreEqual ("LoadOption", ex.ParamName, "#8");
}
}
#endif
[Test]
public void MissingMappingAction_Valid ()
@@ -145,7 +141,6 @@ namespace MonoTests.System.Data.Common
try {
da.MissingMappingAction = (MissingMappingAction) 666;
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentOutOfRangeException ex) {
// The MissingMappingAction enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
@@ -156,17 +151,6 @@ namespace MonoTests.System.Data.Common
Assert.IsNotNull (ex.ParamName, "#7");
Assert.AreEqual ("MissingMappingAction", ex.ParamName, "#8");
}
#else
} catch (ArgumentException ex) {
// The MissingMappingAction enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsTrue (ex.Message.IndexOf ("MissingMappingAction") != -1, "#5");
Assert.IsTrue (ex.Message.IndexOf ("666") != -1, "#6");
Assert.IsNull (ex.ParamName, "#7");
}
#endif
}
[Test]
@@ -188,7 +172,6 @@ namespace MonoTests.System.Data.Common
try {
da.MissingSchemaAction = (MissingSchemaAction) 666;
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentOutOfRangeException ex) {
// The MissingSchemaAction enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
@@ -199,20 +182,8 @@ namespace MonoTests.System.Data.Common
Assert.IsNotNull (ex.ParamName, "#7");
Assert.AreEqual ("MissingSchemaAction", ex.ParamName, "#8");
}
#else
} catch (ArgumentException ex) {
// The MissingSchemaAction enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsTrue (ex.Message.IndexOf ("MissingSchemaAction") != -1, "#5");
Assert.IsTrue (ex.Message.IndexOf ("666") != -1, "#6");
Assert.IsNull (ex.ParamName, "#7");
}
#endif
}
#if NET_2_0
[Test]
public void ReturnProviderSpecificTypes ()
{
@@ -224,31 +195,9 @@ namespace MonoTests.System.Data.Common
da.ReturnProviderSpecificTypes = true;
Assert.IsTrue (da.ReturnProviderSpecificTypes, "#3");
}
#endif
}
class MyAdapter : DataAdapter
{
#if ONLY_1_1
public override int Fill (DataSet dataSet)
{
throw new NotImplementedException ();
}
public override DataTable[] FillSchema (DataSet dataSet, SchemaType schemaType)
{
throw new NotImplementedException ();
}
public override IDataParameter[] GetFillParameters ()
{
throw new NotImplementedException ();
}
public override int Update (DataSet dataSet)
{
throw new NotImplementedException ();
}
#endif
}
}

View File

@@ -25,7 +25,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Data;
using System.Data.Common;
@@ -217,4 +216,3 @@ namespace MonoTests.System.Data.Common
}
}
}
#endif // NET_2_0

View File

@@ -1 +1 @@
361380874dbed88ac3ae96b49ab1f254b5b92b91
0ff9d109c2cf0e230c09e3069a3bb7a6f7873181

View File

@@ -44,7 +44,6 @@ namespace MonoTests.System.Data.Common
[TestFixture]
public class DbDataAdapterTest
{
#if NET_2_0
[Test]
public void UpdateBatchSize ()
{
@@ -260,37 +259,10 @@ sqliteDataAdapter.Update (dataSet, "Primus");
}
#endif
#endif
class MyAdapter : DbDataAdapter
{
#if ONLY_1_1
protected override RowUpdatedEventArgs CreateRowUpdatedEvent (DataRow dataRow, IDbCommand command,
StatementType statementType,
DataTableMapping tableMapping)
{
throw new NotImplementedException ();
}
protected override RowUpdatingEventArgs CreateRowUpdatingEvent (DataRow dataRow, IDbCommand command,
StatementType statementType,
DataTableMapping tableMapping)
{
throw new NotImplementedException ();
}
protected override void OnRowUpdated (RowUpdatedEventArgs value)
{
throw new NotImplementedException ();
}
protected override void OnRowUpdating (RowUpdatingEventArgs value)
{
throw new NotImplementedException ();
}
#endif
#if NET_2_0
public new int AddToBatch (IDbCommand command)
{
return base.AddToBatch (command);
@@ -325,7 +297,6 @@ sqliteDataAdapter.Update (dataSet, "Primus");
{
base.TerminateBatching ();
}
#endif
}
}
}

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System;
using System.Data;
using System.Data.Common;
@@ -100,4 +99,3 @@ namespace MonoTests.System.Data.Common
}
}
}
#endif

View File

@@ -38,7 +38,6 @@ namespace MonoTests.System.Data.Odbc
[TestFixture]
public class OdbcCommandBuilderTest
{
#if NET_2_0
[Test]
public void CatalogLocationTest ()
{
@@ -112,7 +111,6 @@ namespace MonoTests.System.Data.Odbc
}
Assert.AreEqual (ConflictOption.CompareRowVersion, cb.ConflictOption, "#8");
}
#endif
[Test]
public void QuotePrefix ()
@@ -148,7 +146,6 @@ namespace MonoTests.System.Data.Odbc
Assert.AreEqual (" ", cb.QuoteSuffix, "#6");
}
#if NET_2_0
[Test] // QuoteIdentifier (String)
public void QuoteIdentifier1 ()
{
@@ -407,6 +404,5 @@ namespace MonoTests.System.Data.Odbc
cb.SchemaSeparator = " ";
Assert.AreEqual (" ", cb.SchemaSeparator, "#6");
}
#endif
}
}

View File

@@ -217,11 +217,7 @@ namespace MonoTests.System.Data.Odbc
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
#if NET_2_0
Assert.AreEqual ("CommandTimeout", ex.ParamName, "#5");
#else
Assert.IsNull (ex.ParamName, "#5");
#endif
}
}
@@ -232,7 +228,6 @@ namespace MonoTests.System.Data.Odbc
try {
cmd.CommandType = (CommandType) (666);
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentOutOfRangeException ex) {
// The CommandType enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#2");
@@ -241,16 +236,6 @@ namespace MonoTests.System.Data.Odbc
Assert.IsTrue (ex.Message.IndexOf ("666") != -1, "#5:" + ex.Message);
Assert.AreEqual ("CommandType", ex.ParamName, "#6");
}
#else
} catch (ArgumentException ex) {
// The CommandType enumeration value, 666, is invalid
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsTrue (ex.Message.IndexOf ("666") != -1, "#5:" + ex.Message);
Assert.IsNull (ex.ParamName, "#6");
}
#endif
}
[Test]
@@ -270,11 +255,7 @@ namespace MonoTests.System.Data.Odbc
cmd.Dispose ();
#if NET_2_0
Assert.AreEqual (string.Empty, cmd.CommandText, "CommandText");
#else
Assert.AreEqual ("SELECT 'a'", cmd.CommandText, "CommandText");
#endif
Assert.AreEqual (67, cmd.CommandTimeout, "CommandTimeout");
Assert.AreEqual (CommandType.StoredProcedure, cmd.CommandType, "CommandType");
Assert.IsNull (cmd.Connection, "Connection");
@@ -431,7 +412,6 @@ namespace MonoTests.System.Data.Odbc
try {
cmd.UpdatedRowSource = (UpdateRowSource) 666;
Assert.Fail ("#1");
#if NET_2_0
} catch (ArgumentOutOfRangeException ex) {
// The UpdateRowSource enumeration value,666,
// is invalid
@@ -440,16 +420,6 @@ namespace MonoTests.System.Data.Odbc
Assert.IsNotNull (ex.Message, "#4");
Assert.AreEqual ("UpdateRowSource", ex.ParamName, "#5");
}
#else
} catch (ArgumentException ex) {
// The UpdateRowSource enumeration value, 666,
// is invalid
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNull (ex.InnerException, "#3");
Assert.IsNotNull (ex.Message, "#4");
Assert.IsNull (ex.ParamName, "#5");
}
#endif
}
}
}

View File

@@ -29,7 +29,6 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#if NET_2_0
using System;
using System.Collections;
using System.Data;
@@ -832,4 +831,3 @@ namespace MonoTests.System.Data.Odbc
}
}
}
#endif // NET_2_0 using

View File

@@ -128,7 +128,6 @@ namespace MonoTests.System.Data.Odbc
Assert.AreEqual (string.Empty, cn.ConnectionString, "#4");
}
#if NET_2_0
[Test]
public void GetSchema_Connection_Closed ()
{
@@ -204,7 +203,6 @@ namespace MonoTests.System.Data.Odbc
Assert.IsNotNull (ex.Message, "#G4");
}
}
#endif
[Test]
public void ServerVersion_Connection_Closed ()

View File

@@ -43,28 +43,20 @@ namespace MonoTests.System.Data.Odbc
{
OdbcDataAdapter da = new OdbcDataAdapter ();
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNull (da.SelectCommand, "#11");
Assert.IsNull (da.Site, "#12");
Assert.IsNotNull (da.TableMappings, "#13");
Assert.AreEqual (0, da.TableMappings.Count, "#14");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#15");
#endif
Assert.IsNull (da.UpdateCommand, "#16");
}
@@ -74,29 +66,21 @@ namespace MonoTests.System.Data.Odbc
OdbcCommand cmd = new OdbcCommand ();
OdbcDataAdapter da = new OdbcDataAdapter (cmd);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (cmd, da.SelectCommand, "#12");
Assert.IsNull (da.Site, "#13");
Assert.IsNotNull (da.TableMappings, "#14");
Assert.AreEqual (0, da.TableMappings.Count, "#15");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#16");
#endif
Assert.IsNull (da.UpdateCommand, "#17");
}
@@ -105,28 +89,20 @@ namespace MonoTests.System.Data.Odbc
{
OdbcDataAdapter da = new OdbcDataAdapter ((OdbcCommand) null);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNull (da.SelectCommand, "#11");
Assert.IsNull (da.Site, "#12");
Assert.IsNotNull (da.TableMappings, "#13");
Assert.AreEqual (0, da.TableMappings.Count, "#14");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#15");
#endif
Assert.IsNull (da.UpdateCommand, "#16");
}
@@ -139,30 +115,22 @@ namespace MonoTests.System.Data.Odbc
OdbcDataAdapter da = new OdbcDataAdapter (selectCommandText,
selectConnection);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.AreSame (selectConnection, da.SelectCommand.Connection, "#13");
Assert.IsNull (da.Site, "#14");
Assert.IsNotNull (da.TableMappings, "#15");
Assert.AreEqual (0, da.TableMappings.Count, "#16");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#17");
#endif
Assert.IsNull (da.UpdateCommand, "#18");
}
@@ -174,21 +142,15 @@ namespace MonoTests.System.Data.Odbc
OdbcDataAdapter da = new OdbcDataAdapter ((string) null,
selectConnection);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.IsNotNull (da.SelectCommand.CommandText, "#12");
Assert.AreEqual (string.Empty, da.SelectCommand.CommandText, "#13");
@@ -196,9 +158,7 @@ namespace MonoTests.System.Data.Odbc
Assert.IsNull (da.Site, "#15");
Assert.IsNotNull (da.TableMappings, "#16");
Assert.AreEqual (0, da.TableMappings.Count, "#17");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#18");
#endif
Assert.IsNull (da.UpdateCommand, "#19");
}
@@ -210,30 +170,22 @@ namespace MonoTests.System.Data.Odbc
OdbcDataAdapter da = new OdbcDataAdapter (selectCommandText,
(OdbcConnection) null);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.IsNull (da.SelectCommand.Connection, "#13");
Assert.IsNull (da.Site, "#14");
Assert.IsNotNull (da.TableMappings, "#15");
Assert.AreEqual (0, da.TableMappings.Count, "#16");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#17");
#endif
Assert.IsNull (da.UpdateCommand, "#18");
}
@@ -246,21 +198,15 @@ namespace MonoTests.System.Data.Odbc
OdbcDataAdapter da = new OdbcDataAdapter (selectCommandText,
selectConnectionString);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.IsNotNull (da.SelectCommand.Connection, "#13");
@@ -268,9 +214,7 @@ namespace MonoTests.System.Data.Odbc
Assert.IsNull (da.Site, "#15");
Assert.IsNotNull (da.TableMappings, "#16");
Assert.AreEqual (0, da.TableMappings.Count, "#17");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#18");
#endif
Assert.IsNull (da.UpdateCommand, "#19");
}
@@ -282,21 +226,15 @@ namespace MonoTests.System.Data.Odbc
OdbcDataAdapter da = new OdbcDataAdapter ((string) null,
selectConnectionString);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.IsNotNull (da.SelectCommand.CommandText, "#12");
Assert.AreEqual (string.Empty, da.SelectCommand.CommandText, "#13");
@@ -305,9 +243,7 @@ namespace MonoTests.System.Data.Odbc
Assert.IsNull (da.Site, "#16");
Assert.IsNotNull (da.TableMappings, "#17");
Assert.AreEqual (0, da.TableMappings.Count, "#18");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#19");
#endif
Assert.IsNull (da.UpdateCommand, "#20");
}
@@ -319,21 +255,15 @@ namespace MonoTests.System.Data.Odbc
OdbcDataAdapter da = new OdbcDataAdapter (selectCommandText,
(string) null);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.IsNotNull (da.SelectCommand.Connection, "#14");
@@ -341,9 +271,7 @@ namespace MonoTests.System.Data.Odbc
Assert.IsNull (da.Site, "#16");
Assert.IsNotNull (da.TableMappings, "#17");
Assert.AreEqual (0, da.TableMappings.Count, "#18");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#19");
#endif
Assert.IsNull (da.UpdateCommand, "#20");
}
@@ -482,7 +410,6 @@ namespace MonoTests.System.Data.Odbc
}
}
#if NET_2_0
[Test]
public void UpdateBatchSize ()
{
@@ -520,7 +447,6 @@ namespace MonoTests.System.Data.Odbc
Assert.IsNotNull (ex.Message, "#D4");
}
}
#endif
[Test]
public void UpdateCommand ()

View File

@@ -29,7 +29,6 @@
using System.Data.Odbc;
using NUnit.Framework;
#if NET_2_0
namespace MonoTests.System.Data.Odbc
{
[TestFixture]
@@ -48,4 +47,3 @@ namespace MonoTests.System.Data.Odbc
}
}
}
#endif

View File

@@ -49,10 +49,8 @@ namespace MonoTests.System.Data.Odbc {
Assert.AreEqual (String.Empty, a.ConnectionString, "ConnectionString");
Assert.AreEqual (KeyRestrictionBehavior.AllowOnly, a.KeyRestrictionBehavior, "KeyRestrictionBehavior");
Assert.AreEqual (String.Empty, a.KeyRestrictions, "KeyRestrictions");
#if NET_2_0
Assert.IsFalse (a.ShouldSerializeConnectionString (), "ShouldSerializeConnectionString");
Assert.IsFalse (a.ShouldSerializeKeyRestrictions (), "ShouldSerializeConnectionString");
#endif
OdbcPermission odbcp = (OdbcPermission)a.CreatePermission ();
Assert.IsFalse (odbcp.IsUnrestricted (), "IsUnrestricted");
}
@@ -138,11 +136,7 @@ namespace MonoTests.System.Data.Odbc {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentOutOfRangeException))]
#else
[ExpectedException (typeof (ArgumentException))]
#endif
public void KeyRestrictionBehavior_Invalid ()
{
OdbcPermissionAttribute a = new OdbcPermissionAttribute (SecurityAction.Assert);

View File

@@ -52,11 +52,7 @@ namespace MonoTests.System.Data.Odbc {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentOutOfRangeException))]
#else
[ExpectedException (typeof (ArgumentException))]
#endif
public void PermissionState_Invalid ()
{
PermissionState ps = (PermissionState)Int32.MinValue;

View File

@@ -128,7 +128,6 @@ namespace MonoTests.System.Data.OleDb
Assert.AreEqual (string.Empty, cn.ConnectionString, "#4");
}
#if NET_2_0
[Test]
public void GetSchema_Connection_Closed ()
{
@@ -204,7 +203,6 @@ namespace MonoTests.System.Data.OleDb
Assert.IsNotNull (ex.Message, "#G4");
}
}
#endif
[Test]
public void ServerVersion_Connection_Closed ()

View File

@@ -43,28 +43,20 @@ namespace MonoTests.System.Data.OleDb
{
OleDbDataAdapter da = new OleDbDataAdapter ();
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNull (da.SelectCommand, "#11");
Assert.IsNull (da.Site, "#12");
Assert.IsNotNull (da.TableMappings, "#13");
Assert.AreEqual (0, da.TableMappings.Count, "#14");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#15");
#endif
Assert.IsNull (da.UpdateCommand, "#16");
}
@@ -74,29 +66,21 @@ namespace MonoTests.System.Data.OleDb
OleDbCommand cmd = new OleDbCommand ();
OleDbDataAdapter da = new OleDbDataAdapter (cmd);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (cmd, da.SelectCommand, "#12");
Assert.IsNull (da.Site, "#13");
Assert.IsNotNull (da.TableMappings, "#14");
Assert.AreEqual (0, da.TableMappings.Count, "#15");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#16");
#endif
Assert.IsNull (da.UpdateCommand, "#17");
}
@@ -105,28 +89,20 @@ namespace MonoTests.System.Data.OleDb
{
OleDbDataAdapter da = new OleDbDataAdapter ((OleDbCommand) null);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNull (da.SelectCommand, "#11");
Assert.IsNull (da.Site, "#12");
Assert.IsNotNull (da.TableMappings, "#13");
Assert.AreEqual (0, da.TableMappings.Count, "#14");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#15");
#endif
Assert.IsNull (da.UpdateCommand, "#16");
}
@@ -139,30 +115,22 @@ namespace MonoTests.System.Data.OleDb
OleDbDataAdapter da = new OleDbDataAdapter (selectCommandText,
selectConnection);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.AreSame (selectConnection, da.SelectCommand.Connection, "#13");
Assert.IsNull (da.Site, "#14");
Assert.IsNotNull (da.TableMappings, "#15");
Assert.AreEqual (0, da.TableMappings.Count, "#16");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#17");
#endif
Assert.IsNull (da.UpdateCommand, "#18");
}
@@ -174,21 +142,15 @@ namespace MonoTests.System.Data.OleDb
OleDbDataAdapter da = new OleDbDataAdapter ((string) null,
selectConnection);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.IsNotNull (da.SelectCommand.CommandText, "#12");
Assert.AreEqual (string.Empty, da.SelectCommand.CommandText, "#13");
@@ -196,9 +158,7 @@ namespace MonoTests.System.Data.OleDb
Assert.IsNull (da.Site, "#15");
Assert.IsNotNull (da.TableMappings, "#16");
Assert.AreEqual (0, da.TableMappings.Count, "#17");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#18");
#endif
Assert.IsNull (da.UpdateCommand, "#19");
}
@@ -210,30 +170,22 @@ namespace MonoTests.System.Data.OleDb
OleDbDataAdapter da = new OleDbDataAdapter (selectCommandText,
(OleDbConnection) null);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.IsNull (da.SelectCommand.Connection, "#13");
Assert.IsNull (da.Site, "#14");
Assert.IsNotNull (da.TableMappings, "#15");
Assert.AreEqual (0, da.TableMappings.Count, "#16");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#17");
#endif
Assert.IsNull (da.UpdateCommand, "#18");
}
@@ -246,21 +198,15 @@ namespace MonoTests.System.Data.OleDb
OleDbDataAdapter da = new OleDbDataAdapter (selectCommandText,
selectConnectionString);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.IsNotNull (da.SelectCommand.Connection, "#13");
@@ -268,9 +214,7 @@ namespace MonoTests.System.Data.OleDb
Assert.IsNull (da.Site, "#15");
Assert.IsNotNull (da.TableMappings, "#16");
Assert.AreEqual (0, da.TableMappings.Count, "#17");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#18");
#endif
Assert.IsNull (da.UpdateCommand, "#19");
}
@@ -282,21 +226,15 @@ namespace MonoTests.System.Data.OleDb
OleDbDataAdapter da = new OleDbDataAdapter ((string) null,
selectConnectionString);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.IsNotNull (da.SelectCommand.CommandText, "#12");
Assert.AreEqual (string.Empty, da.SelectCommand.CommandText, "#13");
@@ -305,9 +243,7 @@ namespace MonoTests.System.Data.OleDb
Assert.IsNull (da.Site, "#16");
Assert.IsNotNull (da.TableMappings, "#17");
Assert.AreEqual (0, da.TableMappings.Count, "#18");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#19");
#endif
Assert.IsNull (da.UpdateCommand, "#20");
}
@@ -319,21 +255,15 @@ namespace MonoTests.System.Data.OleDb
OleDbDataAdapter da = new OleDbDataAdapter (selectCommandText,
(string) null);
Assert.IsTrue (da.AcceptChangesDuringFill, "#1");
#if NET_2_0
Assert.IsTrue (da.AcceptChangesDuringUpdate, "#2");
#endif
Assert.IsNull (da.Container, "#3");
Assert.IsFalse (da.ContinueUpdateOnError, "#4");
Assert.IsNull (da.DeleteCommand, "#5");
#if NET_2_0
Assert.AreEqual (LoadOption.OverwriteChanges, da.FillLoadOption, "#6");
#endif
Assert.IsNull (da.InsertCommand, "#7");
Assert.AreEqual (MissingMappingAction.Passthrough, da.MissingMappingAction, "#8");
Assert.AreEqual (MissingSchemaAction.Add, da.MissingSchemaAction, "#9");
#if NET_2_0
Assert.IsFalse (da.ReturnProviderSpecificTypes, "#10");
#endif
Assert.IsNotNull (da.SelectCommand, "#11");
Assert.AreSame (selectCommandText, da.SelectCommand.CommandText, "#12");
Assert.IsNotNull (da.SelectCommand.Connection, "#14");
@@ -341,9 +271,7 @@ namespace MonoTests.System.Data.OleDb
Assert.IsNull (da.Site, "#16");
Assert.IsNotNull (da.TableMappings, "#17");
Assert.AreEqual (0, da.TableMappings.Count, "#18");
#if NET_2_0
Assert.AreEqual (1, da.UpdateBatchSize, "#19");
#endif
Assert.IsNull (da.UpdateCommand, "#20");
}

View File

@@ -29,7 +29,6 @@
using System.Data.OleDb;
using NUnit.Framework;
#if NET_2_0
namespace MonoTests.System.Data.OleDb
{
[TestFixture]
@@ -50,4 +49,3 @@ namespace MonoTests.System.Data.OleDb
}
}
}
#endif

View File

@@ -37,7 +37,6 @@ namespace MonoTests.System.Data.OleDb {
[TestFixture]
public class OleDbParameterCollectionTest {
#if NET_2_0
[Test]
public void AddWithValueTest ()
{
@@ -54,6 +53,5 @@ namespace MonoTests.System.Data.OleDb {
Assert.AreEqual(1, parameters.Count);
Assert.AreEqual(parameter, parameters[0]);
}
#endif
}
}

View File

@@ -50,10 +50,8 @@ namespace MonoTests.System.Data.OleDb {
Assert.AreEqual (KeyRestrictionBehavior.AllowOnly, a.KeyRestrictionBehavior, "KeyRestrictionBehavior");
Assert.AreEqual (String.Empty, a.KeyRestrictions, "KeyRestrictions");
Assert.AreEqual (String.Empty, a.Provider, "Provider");
#if NET_2_0
Assert.IsFalse (a.ShouldSerializeConnectionString (), "ShouldSerializeConnectionString");
Assert.IsFalse (a.ShouldSerializeKeyRestrictions (), "ShouldSerializeConnectionString");
#endif
OleDbPermission odp = (OleDbPermission)a.CreatePermission ();
Assert.IsFalse (odp.IsUnrestricted (), "IsUnrestricted");
}
@@ -139,11 +137,7 @@ namespace MonoTests.System.Data.OleDb {
}
[Test]
#if NET_2_0
[ExpectedException (typeof (ArgumentOutOfRangeException))]
#else
[ExpectedException (typeof (ArgumentException))]
#endif
public void KeyRestrictionBehavior_Invalid ()
{
OleDbPermissionAttribute a = new OleDbPermissionAttribute (SecurityAction.Assert);
@@ -182,12 +176,8 @@ namespace MonoTests.System.Data.OleDb {
Assert.AreEqual ("Mono", a.Provider, "Mono");
OleDbPermission odp = (OleDbPermission) a.CreatePermission ();
#if NET_2_0
// provider isn't even supplied to permission in fx 2.0
Assert.AreEqual (String.Empty, odp.Provider, "CreatePermission.Provider");
#else
Assert.AreEqual ("Mono", odp.Provider, "CreatePermission.Provider");
#endif
}
[Test]

Some files were not shown because too many files have changed in this diff Show More