Skip to content

Commit a685288

Browse files
committed
Use new AdoNet.Specification.Tests test suite.
1 parent 06703db commit a685288

File tree

9 files changed

+108
-1
lines changed

9 files changed

+108
-1
lines changed

.ci/test.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ if ($LASTEXITCODE -ne 0){
1717
exit $LASTEXITCODE;
1818
}
1919
popd
20+
pushd tests\Conformance.Tests
21+
dotnet xunit -c Release
22+
if ($LASTEXITCODE -ne 0){
23+
exit $LASTEXITCODE;
24+
}
25+
popd
2026

2127
pushd .\tests\SideBySide
2228

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ before_install:
3030
script:
3131
- dotnet restore
3232
- pushd tests/MySqlConnector.Tests && dotnet xunit -c Release && popd
33+
- pushd tests/Conformance.Tests && CONNECTION_STRING="Server=localhost;Port=3307;User Id=mysqltest;Password='test;key=\"val';SSL Mode=None" dotnet xunit -c Release && popd
3334
- pushd tests/SideBySide
3435
- dotnet build SideBySide.csproj -c Release -f netcoreapp2.0
3536
- echo 'Executing netcoreapp1.1.2 tests with No Compression, No SSL' && ../../.ci/use-config.sh config.json 172.17.0.1 3307 $NAME $FEATURES && time dotnet xunit -c Release -f netcoreapp1.1.2

MySqlConnector.sln

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
3-
VisualStudioVersion = 15.0.26228.4
3+
VisualStudioVersion = 15.0.27004.2009
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector", "src\MySqlConnector\MySqlConnector.csproj", "{F82378AF-274E-4FBA-8E45-27126D607B85}"
66
EndProject
@@ -10,6 +10,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SideBySide", "tests\SideByS
1010
EndProject
1111
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MySqlConnector.Performance", "tests\MySqlConnector.Performance\MySqlConnector.Performance.csproj", "{4339142B-382C-481E-83CF-B7E4A34AD171}"
1212
EndProject
13+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Conformance.Tests", "tests\Conformance.Tests\Conformance.Tests.csproj", "{CC0DA702-43E8-471E-9320-F36685C540A1}"
14+
EndProject
1315
Global
1416
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1517
Debug|Any CPU = Debug|Any CPU
@@ -32,8 +34,15 @@ Global
3234
{4339142B-382C-481E-83CF-B7E4A34AD171}.Debug|Any CPU.Build.0 = Debug|Any CPU
3335
{4339142B-382C-481E-83CF-B7E4A34AD171}.Release|Any CPU.ActiveCfg = Release|Any CPU
3436
{4339142B-382C-481E-83CF-B7E4A34AD171}.Release|Any CPU.Build.0 = Release|Any CPU
37+
{CC0DA702-43E8-471E-9320-F36685C540A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38+
{CC0DA702-43E8-471E-9320-F36685C540A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
39+
{CC0DA702-43E8-471E-9320-F36685C540A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{CC0DA702-43E8-471E-9320-F36685C540A1}.Release|Any CPU.Build.0 = Release|Any CPU
3541
EndGlobalSection
3642
GlobalSection(SolutionProperties) = preSolution
3743
HideSolutionNode = FALSE
3844
EndGlobalSection
45+
GlobalSection(ExtensibilityGlobals) = postSolution
46+
SolutionGuid = {4784EA55-5DE0-404F-8BEC-E14C202F01FA}
47+
EndGlobalSection
3948
EndGlobal
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using AdoNet.Specification.Tests;
2+
using Xunit;
3+
4+
namespace Conformance.Tests
5+
{
6+
public sealed class CommandTests : CommandTestBase<DbFactoryFixture>
7+
{
8+
public CommandTests(DbFactoryFixture fixture)
9+
: base(fixture)
10+
{
11+
}
12+
}
13+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
5+
<VersionPrefix>0.1.0</VersionPrefix>
6+
<SignAssembly>true</SignAssembly>
7+
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
8+
<AssemblyOriginatorKeyFile>..\..\MySqlConnector.snk</AssemblyOriginatorKeyFile>
9+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
10+
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="AdoNet.Specification.Tests" Version="1.0.0" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
16+
<PackageReference Include="xunit" Version="2.3.1" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
18+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
19+
<ProjectReference Include="..\..\src\MySqlConnector\MySqlConnector.csproj" />
20+
</ItemGroup>
21+
22+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using AdoNet.Specification.Tests;
2+
using Xunit;
3+
4+
namespace Conformance.Tests
5+
{
6+
public sealed class ConnectionTests : ConnectionTestBase<DbFactoryFixture>
7+
{
8+
public ConnectionTests(DbFactoryFixture fixture)
9+
: base(fixture)
10+
{
11+
}
12+
13+
[Fact(Skip = "Throws MySqlException when it attempts to connect, not InvalidOperationException before connecting")]
14+
public override void Open_throws_when_no_connection_string()
15+
{
16+
}
17+
}
18+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using AdoNet.Specification.Tests;
2+
3+
namespace Conformance.Tests
4+
{
5+
public sealed class DataReaderTests : DataReaderTestBase<DbFactoryFixture>
6+
{
7+
public DataReaderTests(DbFactoryFixture fixture)
8+
: base(fixture)
9+
{
10+
}
11+
}
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.Data.Common;
2+
using AdoNet.Specification.Tests.Databases;
3+
using MySql.Data.MySqlClient;
4+
5+
namespace Conformance.Tests
6+
{
7+
public sealed class DbFactoryFixture : DbFactoryFixtureBase<MySqlDatabase>
8+
{
9+
public override DbProviderFactory Factory => MySqlClientFactory.Instance;
10+
}
11+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using AdoNet.Specification.Tests.Databases;
3+
4+
namespace Conformance.Tests
5+
{
6+
public sealed class MySqlDatabase : MySqlDatabaseBase
7+
{
8+
public MySqlDatabase()
9+
{
10+
ConnectionString = Environment.GetEnvironmentVariable("CONNECTION_STRING") ?? "Server=localhost;User Id=mysqltest;Password='test;key=\"val';SSL Mode=None";
11+
}
12+
13+
public override string ConnectionString { get; }
14+
}
15+
}

0 commit comments

Comments
 (0)