using System.Data.Common;
using System.Data.SqlClient;
using System.Data.SqlTypes;
-using Mono.Data;
using NUnit.Framework;
-namespace MonoTests.System.Data
+namespace MonoTests.System.Data.Connected.SqlClient
{
[TestFixture]
[Category ("sqlserver")]
[TestFixtureSetUp]
public void init ()
{
- conn = new SqlConnection (ConnectionManager.Singleton.ConnectionString);
- engine = ConnectionManager.Singleton.Engine;
+ conn = new SqlConnection (ConnectionManager.Instance.Sql.ConnectionString);
+ engine = ConnectionManager.Instance.Sql.EngineConfig;
}
private static EngineConfig Engine {
{
conn.Open ();
}
+
[TearDown]
public void TearDown ()
{
- conn.Close ();
+ conn?.Close ();
}
[Test]
+ [Category("NotWorking")]
public void GetInsertCommand1 ()
{
SqlCommand cmd = null;
}
[Test]
+ [Category("NotWorking")]
public void GetInsertCommand1_Expression ()
{
SqlCommand cmd = null;
}
[Test] // GetInsertCommand (Boolean)
+ [Category("NotWorking")]
public void GetInsertCommand2 ()
{
SqlCommand cmd = null;
}
[Test] // GetUpdateCommand ()
+ [Category("NotWorking")]
public void GetUpdateCommand1 ()
{
SqlCommand cmd = null;
}
[Test] // GetUpdateCommand (Boolean)
+ [Category("NotWorking")]
public void GetUpdateCommand2 ()
{
SqlCommand cmd = null;
}
[Test]
+ [Category("NotWorking")]
public void GetUpdateCommandDBConcurrencyExceptionTest ()
{
string selectQuery = "select id, fname from employee where id = 1";
}
[Test]
+ [Category("NotWorking")]
public void GetDeleteCommandDBConcurrencyExceptionTest ()
{
string selectQuery = "select id, fname from employee where id = 1";
}
[Test] // GetDeleteCommand ()
+ [Category("NotWorking")]
public void GetDeleteCommand1 ()
{
SqlCommand cmd = null;
}
[Test] // GetDeleteCommand ()
+ [Category("NotWorking")]
public void GetDeleteCommand2 ()
{
SqlCommand cmd = null;
}
[Test]
+ [Category("NotWorking")]
public void DefaultProperties ()
{
SqlCommandBuilder cb = new SqlCommandBuilder ();
// FIXME: Add test for ContinueUpdateOnError property
[Test]
+ [Category("NotWorking")]
public void CheckParameters_BuiltCommand ()
{
SqlDataAdapter adapter = new SqlDataAdapter ("select id,type_varchar from string_family", conn);
}
[Test]
+ [Category("NotWorking")]
public void DeriveParameters ()
{
SqlCommand cmd = null;
Assert.IsFalse (param.IsNullable, "#D:IsNullable");
Assert.AreEqual ("@param1", param.ParameterName, "#D:ParameterName");
Assert.AreEqual (5, param.Precision, "#D:Precision");
- if (ClientVersion == 7)
- Assert.AreEqual (2, param.Scale, "#D:Scale");
- else
- Assert.AreEqual (3, param.Scale, "#D:Scale");
+ Assert.AreEqual (2, param.Scale, "#D:Scale");
//Assert.AreEqual (0, param.Size, "#D:Size");
Assert.AreEqual (SqlDbType.Decimal, param.SqlDbType, "#D:SqlDbType");
Assert.IsNull (param.Value, "#D:Value");
else
Assert.AreEqual ("@p1", param.ParameterName, prefix + "ParameterName (0)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
-
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (0)");
//Assert.AreEqual (0, param.Size, prefix + "Size (0)");
Assert.AreEqual ("id", param.SourceColumn, prefix + "SourceColumn (0)");
else
Assert.AreEqual ("@p1", param.ParameterName, prefix + "ParameterName (0)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (0)");
//Assert.AreEqual (0, param.Size, prefix + "Size (0)");
else
Assert.AreEqual ("@p1", param.ParameterName, prefix + "ParameterName (0)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (0)");
//Assert.AreEqual (0, param.Size, prefix + "Size (0)");
else
Assert.AreEqual ("@p4", param.ParameterName, prefix + "ParameterName (3)");
- if (ClientVersion > 7)
- Assert.AreEqual (0, param.Precision, prefix + "Precision (0)");
- else
- Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
+ Assert.AreEqual (10, param.Precision, prefix + "Precision (0)");
Assert.AreEqual (0, param.Scale, prefix + "Scale (3)");
//Assert.AreEqual (0, param.Size, prefix + "Size (3)");