Skip to content

Commit

Permalink
Add package README.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Oct 20, 2023
1 parent 1f1a464 commit 30a0b6b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<Authors>Bradley Grainger</Authors>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageTags>ado.net;database;test</PackageTags>
<PackageReleaseNotes>https://github.com/mysql-net/AdoNetApiTest/blob/master/VersionHistory.md</PackageReleaseNotes>
<PackageProjectUrl>https://mysql-net.github.io/AdoNetResults/</PackageProjectUrl>
Expand All @@ -38,4 +39,8 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
43 changes: 43 additions & 0 deletions src/AdoNet.Specification.Tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## ADO.NET Specification Tests

This package provides base classes that let you test your ADO.NET library for conformance to common ADO.NET patterns.
ADO.NET doesn't have a formal specification for ADO.NET providers, but many libraries (such as
[Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient),
[Npgsql](https://www.nuget.org/packages/Npgsql), and [MySqlConnector](https://www.nuget.org/packages/MySqlConnector))
exhibit similar behavior.

### Usage

Create a test project that uses [xunit](https://www.nuget.org/packages/xunit).

Write a class that implements `IDbFactoryFixture`:

```csharp
public class DbFactoryFixture : IDbFactoryFixture
{
public DbFactoryFixture()
{
ConnectionString ="your test connection string";
}

public string ConnectionString { get; }
public DbProviderFactory Factory => YourDbProviderFactory.Instance;
}
```

Then write test classes that inherit from the classes in this package, e.g.,

```csharp
public sealed class ConnectionTests : ConnectionTestBase<DbFactoryFixture>
{
public ConnectionTests(DbFactoryFixture fixture)
: base(fixture)
{
}

[Fact(Skip = "Override a method and provide a 'Skip' reason to opt out of a test.")]
public override void Set_ConnectionString_throws_when_invalid()
{
}
}
```

0 comments on commit 30a0b6b

Please sign in to comment.