File tree 2 files changed +48
-0
lines changed
src/AdoNet.Specification.Tests
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 13
13
<Authors >Bradley Grainger</Authors >
14
14
<TargetFrameworks >netstandard2.0;netstandard2.1</TargetFrameworks >
15
15
<TreatWarningsAsErrors >true</TreatWarningsAsErrors >
16
+ <PackageReadmeFile >README.md</PackageReadmeFile >
16
17
<PackageTags >ado.net;database;test</PackageTags >
17
18
<PackageReleaseNotes >https://github.com/mysql-net/AdoNetApiTest/blob/master/VersionHistory.md</PackageReleaseNotes >
18
19
<PackageProjectUrl >https://mysql-net.github.io/AdoNetResults/</PackageProjectUrl >
38
39
<PackageReference Include =" Microsoft.SourceLink.GitHub" Version =" 1.1.1" PrivateAssets =" All" />
39
40
</ItemGroup >
40
41
42
+ <ItemGroup >
43
+ <None Include =" README.md" Pack =" true" PackagePath =" \" />
44
+ </ItemGroup >
45
+
41
46
</Project >
Original file line number Diff line number Diff line change
1
+ ## ADO.NET Specification Tests
2
+
3
+ This package provides base classes that let you test your ADO.NET library for conformance to common ADO.NET patterns.
4
+ ADO.NET doesn't have a formal specification for ADO.NET providers, but many libraries (such as
5
+ [ Microsoft.Data.SqlClient] ( https://www.nuget.org/packages/Microsoft.Data.SqlClient ) ,
6
+ [ Npgsql] ( https://www.nuget.org/packages/Npgsql ) , and [ MySqlConnector] ( https://www.nuget.org/packages/MySqlConnector ) )
7
+ exhibit similar behavior.
8
+
9
+ ### Usage
10
+
11
+ Create a test project that uses [ xunit] ( https://www.nuget.org/packages/xunit ) .
12
+
13
+ Write a class that implements ` IDbFactoryFixture ` :
14
+
15
+ ``` csharp
16
+ public class DbFactoryFixture : IDbFactoryFixture
17
+ {
18
+ public DbFactoryFixture ()
19
+ {
20
+ ConnectionString = " your test connection string" ;
21
+ }
22
+
23
+ public string ConnectionString { get ; }
24
+ public DbProviderFactory Factory => YourDbProviderFactory .Instance ;
25
+ }
26
+ ```
27
+
28
+ Then write test classes that inherit from the classes in this package, e.g.,
29
+
30
+ ``` csharp
31
+ public sealed class ConnectionTests : ConnectionTestBase <DbFactoryFixture >
32
+ {
33
+ public ConnectionTests (DbFactoryFixture fixture )
34
+ : base (fixture )
35
+ {
36
+ }
37
+
38
+ [Fact (Skip = " Override a method and provide a 'Skip' reason to opt out of a test." )]
39
+ public override void Set_ConnectionString_throws_when_invalid ()
40
+ {
41
+ }
42
+ }
43
+ ```
You can’t perform that action at this time.
0 commit comments