diff --git a/Dapper.Tests.Contrib/Dapper.Tests.Contrib.csproj b/Dapper.Tests.Contrib/Dapper.Tests.Contrib.csproj
index dd9a7dd3..5c5d6ce6 100644
--- a/Dapper.Tests.Contrib/Dapper.Tests.Contrib.csproj
+++ b/Dapper.Tests.Contrib/Dapper.Tests.Contrib.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/Dapper.Tests.Contrib/TestSuites.cs b/Dapper.Tests.Contrib/TestSuites.cs
index 88cafece..31ef7f37 100644
--- a/Dapper.Tests.Contrib/TestSuites.cs
+++ b/Dapper.Tests.Contrib/TestSuites.cs
@@ -37,7 +37,7 @@ namespace Dapper.Tests.Contrib
using (var connection = new SqlConnection(ConnectionString))
{
// ReSharper disable once AccessToDisposedClosure
- Action dropTable = name => connection.Execute($"IF OBJECT_ID('{name}', 'U') IS NOT NULL DROP TABLE [{name}]; ");
+ void dropTable(string name) => connection.Execute($"IF OBJECT_ID('{name}', 'U') IS NOT NULL DROP TABLE [{name}]; ");
connection.Open();
dropTable("Stuff");
connection.Execute("CREATE TABLE Stuff (TheId int IDENTITY(1,1) not null, Name nvarchar(100) not null, Created DateTime null);");
@@ -65,12 +65,10 @@ namespace Dapper.Tests.Contrib
public class MySqlServerTestSuite : TestSuite
{
- private const string DbName = "DapperContribTests";
-
public static string ConnectionString { get; } =
IsAppVeyor
- ? "Server=localhost;Uid=root;Pwd=Password12!;"
- : "Server=localhost;Uid=test;Pwd=pass;";
+ ? "Server=localhost;Database=test;Uid=root;Pwd=Password12!;UseAffectedRows=false;"
+ : "Server=localhost;Database=tests;Uid=test;Pwd=pass;UseAffectedRows=false;";
public override IDbConnection GetConnection()
{
@@ -87,9 +85,8 @@ namespace Dapper.Tests.Contrib
using (var connection = new MySqlConnection(ConnectionString))
{
// ReSharper disable once AccessToDisposedClosure
- Action dropTable = name => connection.Execute($"DROP TABLE IF EXISTS `{name}`;");
+ void dropTable(string name) => connection.Execute($"DROP TABLE IF EXISTS `{name}`;");
connection.Open();
- connection.Execute($"DROP DATABASE IF EXISTS {DbName}; CREATE DATABASE {DbName}; USE {DbName};");
dropTable("Stuff");
connection.Execute("CREATE TABLE Stuff (TheId int not null AUTO_INCREMENT PRIMARY KEY, Name nvarchar(100) not null, Created DateTime null);");
dropTable("People");
diff --git a/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj b/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj
index dd4ec0bd..7299588b 100644
--- a/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj
+++ b/Dapper.Tests.Performance/Dapper.Tests.Performance.csproj
@@ -19,9 +19,8 @@
-
-
+
@@ -46,6 +45,6 @@
-
+
diff --git a/Dapper.Tests/Dapper.Tests.csproj b/Dapper.Tests/Dapper.Tests.csproj
index 373fd7c9..13aea73f 100644
--- a/Dapper.Tests/Dapper.Tests.csproj
+++ b/Dapper.Tests/Dapper.Tests.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/build.ps1 b/build.ps1
index bdbf83f3..de16c65b 100644
--- a/build.ps1
+++ b/build.ps1
@@ -29,17 +29,15 @@ if ($PullRequestNumber) {
$CreatePackages = $false
}
-Write-Host "Building projects..." -ForegroundColor "Magenta"
-foreach ($project in $projectsToBuild + $testsToRun) {
- Write-Host "Building $project (dotnet restore/build)..." -ForegroundColor "Magenta"
- dotnet restore ".\$project\$project.csproj" /p:CI=true
- dotnet build ".\$project\$project.csproj" -c Release /p:CI=true
- Write-Host ""
-}
+Write-Host "Restoring all projects..." -ForegroundColor "Magenta"
+dotnet restore
+Write-Host "Done restoring." -ForegroundColor "Green"
+
+Write-Host "Building all projects..." -ForegroundColor "Magenta"
+dotnet build -c Release --no-restore /p:CI=true
Write-Host "Done building." -ForegroundColor "Green"
if ($RunTests) {
- dotnet restore /ConsoleLoggerParameters:Verbosity=Quiet
foreach ($project in $testsToRun) {
Write-Host "Running tests: $project (all frameworks)" -ForegroundColor "Magenta"
Push-Location ".\$project"