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

@@ -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;