Commit 096b4ac0 authored by Marc Gravell's avatar Marc Gravell

Update to sqlite rc2, because without that nothing works; add extra tests...

Update to sqlite rc2, because without that nothing works; add extra tests around sqlite oddities; update tests to reflect sqlite rc2 fixes
parent df77f394
......@@ -2,7 +2,7 @@
"profiles": {
"test": {
"commandName": "test",
"sdkVersion": "dnx-clr-win-x86.1.0.0-rc1-update1"
"sdkVersion": "dnx-coreclr-win-x86.1.0.0-rc1-update1"
}
}
}
\ No newline at end of file
......@@ -8,6 +8,10 @@
using IDataReader = System.Data.Common.DbDataReader;
#endif
#if SQLITE && (NET40 || NET45)
using SqliteConnection = System.Data.SQLite.SQLiteConnection;
#endif
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
......@@ -42,8 +46,12 @@
using Npgsql;
#endif
#if SQLITE
#if NET40 || NET45
using System.Data.SQLite;
#else
using Microsoft.Data.Sqlite;
#endif
#endif
#if ASYNC
using System.Threading.Tasks;
#endif
......@@ -2109,6 +2117,43 @@ public void AdoNetEnumValue()
}
}
[Fact]
public void DapperEnumValue_SqlServer()
{
DapperEnumValue(connection);
}
#if SQLITE
[FactSqlite]
public void DapperEnumValue_Sqlite()
{
using (var connection = GetSqliteConnection())
{
DapperEnumValue(connection);
}
}
#endif
#if MYSQL
[FactMySql]
public void DapperEnumValue_Mysql()
{
using (var connection = GetMySqlConnection())
{
DapperEnumValue(connection);
}
}
#endif
private static void DapperEnumValue(IDbConnection connection)
{
var v = connection.QuerySingle<AnEnum>("select @v", new { v = AnEnum.B });
v.IsEqualTo(AnEnum.B);
var args = new DynamicParameters();
args.Add("v", AnEnum.B);
v = connection.QuerySingle<AnEnum>("select @v", args);
v.IsEqualTo(AnEnum.B);
}
[Fact]
public void LiteralReplacementEnumAndString()
{
......@@ -3578,6 +3623,7 @@ public async Task Issue466_SqliteHatesOptimizations_Async()
row.Id.IsEqualTo(42);
}
}
#endif
[FactSqlite]
public void Isse467_SqliteLikesParametersWithPrefix()
......@@ -3585,19 +3631,9 @@ public void Isse467_SqliteLikesParametersWithPrefix()
Isse467_SqliteParameterNaming(true);
}
[FactSqlite]
public void Isse467_SqliteHatesParametersWithoutPrefix()
{ // see issue 375 / 467
#if DNX
try {
Isse467_SqliteParameterNaming(false);
throw new Exception("Expected failure");
} catch(InvalidOperationException ex)
{
ex.Message.IsEqualTo("Must add values for the following parameters: @foo");
}
#else
public void Isse467_SqliteLikesParametersWithoutPrefix()
{ // see issue 375 / 467; note: fixed from RC2 onwards
Isse467_SqliteParameterNaming(false);
#endif
}
private void Isse467_SqliteParameterNaming(bool prefix)
{
......@@ -3605,13 +3641,16 @@ private void Isse467_SqliteParameterNaming(bool prefix)
{
var cmd = connection.CreateCommand();
cmd.CommandText = "select @foo";
cmd.Parameters.Add(prefix ? "@foo" : "foo", SqliteType.Integer).Value = 42;
#if NET40 || NET45
const DbType type = DbType.Int32;
#else
const SqliteType type = SqliteType.Integer;
#endif
cmd.Parameters.Add(prefix ? "@foo" : "foo", type).Value = 42;
var i = Convert.ToInt32(cmd.ExecuteScalar());
i.IsEqualTo(42);
}
}
#endif
public class FactSqliteAttribute : FactAttribute
{
public override string Skip
......@@ -3639,5 +3678,5 @@ protected static SqliteConnection GetSqliteConnection(bool open = true)
return connection;
}
#endif
}
}
}
......@@ -36,7 +36,8 @@
"MASSIVE",
"ORMLITE",
"SOMA",
"SIMPLEDATA"
"SIMPLEDATA",
"SQLITE"
]
},
"frameworkAssemblies": {
......@@ -51,6 +52,7 @@
},
"EntityFramework": "6.1.3",
"FirebirdSql.Data.FirebirdClient": "4.10.0",
"Microsoft.SqlServer.Compact": "4.0.8876.1",
"Microsoft.SqlServer.Types": "11.0.2",
"MySql.Data": "6.9.8",
"NHibernate": "4.0.4.4000",
......@@ -60,9 +62,8 @@
"Simple.Data.Core": "1.0.0-rc3",
"Simple.Data.SqlServer": "1.0.0-rc3",
"Soma": "1.8.0.7",
"Microsoft.SqlServer.Compact": "4.0.8876.1",
"xunit": "1.9.2",
"System.Data.SQLite": "1.0.99"
"System.Data.SQLite": "1.0.99",
"xunit": "1.9.2"
}
},
"net45": {
......@@ -80,6 +81,7 @@
"ORMLITE",
"SOMA",
"SIMPLEDATA",
"SQLITE",
"XUNIT2"
]
},
......@@ -96,6 +98,7 @@
},
"EntityFramework": "6.1.3",
"FirebirdSql.Data.FirebirdClient": "4.10.0",
"Microsoft.SqlServer.Compact": "4.0.8876.1",
"Microsoft.SqlServer.Types": "11.0.2",
"MySql.Data": "6.9.8",
"NHibernate": "4.0.4.4000",
......@@ -108,9 +111,8 @@
"Soma": "1.8.0.7",
"Susanoo.Core": "1.2.4",
"Susanoo.SqlServer": "1.2.4",
"Microsoft.SqlServer.Compact": "4.0.8876.1",
"xunit": "2.1.0",
"System.Data.SQLite": "1.0.99"
"System.Data.SQLite": "1.0.99",
"xunit": "2.1.0"
}
},
"dotnet5.4": {
......@@ -119,7 +121,7 @@
},
"dependencies": {
"Microsoft.CSharp": "4.0.1-*",
"Microsoft.Data.Sqlite": "1.0.0-rc1-final",
"Microsoft.Data.Sqlite": "1.0.0-rc2-15948",
"System.Collections": "4.0.11-*",
"System.Console": "4.0.0-*",
"System.Data.SqlClient": "4.0.0-*",
......@@ -163,7 +165,7 @@
},
"EntityFramework": "6.1.3",
"FirebirdSql.Data.FirebirdClient": "4.10.0",
"Microsoft.Data.Sqlite": "1.0.0-rc1-final",
"Microsoft.Data.Sqlite": "1.0.0-rc2-15948",
"Microsoft.SqlServer.Compact": "4.0.8876.1",
"Microsoft.SqlServer.Types": "11.0.2",
"MySql.Data": "6.9.8",
......@@ -187,7 +189,7 @@
"define": [ "COREFX", "ASYNC", "DNX", "XUNIT2", "SQLITE" ]
},
"dependencies": {
"Microsoft.Data.Sqlite": "1.0.0-rc1-final",
"Microsoft.Data.Sqlite": "1.0.0-rc2-15948",
"System.Text.RegularExpressions": "4.0.11-*",
"xunit": "2.2.0-beta1-build3239",
"xunit.runner.dnx": "2.1.0-rc1-build204"
......
......@@ -6,5 +6,6 @@
<add key="CoreCLR" value="https://www.myget.org/F/dotnet-coreclr/api/v3/index.json" />
-->
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="aspnetvnext" value="https://www.myget.org/F/aspnetvnext/"/>
</packageSources>
</configuration>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment