VulcanAnalytics.DBTester 0.8.0-alpha

This is a prerelease version of VulcanAnalytics.DBTester.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package VulcanAnalytics.DBTester --version 0.8.0-alpha                
NuGet\Install-Package VulcanAnalytics.DBTester -Version 0.8.0-alpha                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="VulcanAnalytics.DBTester" Version="0.8.0-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VulcanAnalytics.DBTester --version 0.8.0-alpha                
#r "nuget: VulcanAnalytics.DBTester, 0.8.0-alpha"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install VulcanAnalytics.DBTester as a Cake Addin
#addin nuget:?package=VulcanAnalytics.DBTester&version=0.8.0-alpha&prerelease

// Install VulcanAnalytics.DBTester as a Cake Tool
#tool nuget:?package=VulcanAnalytics.DBTester&version=0.8.0-alpha&prerelease                

DBTester

What is DBTester?

DBTester is a testing framework library built to remove the need for database plumbing and repetitive code for performing utility actions from one test project to the next. Afterall why copy and paste the same database code from one project to the next, or worse still, write it out again?

This library is available through NuGet for immediate inclusion in your projects.

Further information to this README is available on the wiki

Ok, but what can I actually do with DBTester?

First, create an instance of DBTester with the MSSQL database you wish to interact with;

using VulcanAnalytics.DBTester;
var connectionstring = @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=tempdb;Integrated Security=SSPI;";
DatabaseTester tester = new MsSqlDatabaseTester(connectionstring);

Secondly, use one or more of the functions to interact with or check a condition from the database;

var schema = "dbo";
var table = "testtable";

var hasTable = tester.HasTable(schema, table);

Assert.IsTrue(hasTable);

And there we have it, no need to decide on how to use various other database libraries or SQL scripts, just one succint place to come to for database testing utilities.

This list of methods is short today, but increasing (as the database projects I'm currently working on requires further unit testing).

Where did this come from?

This project has been born of the experience I have had in writing the same code for database unit and user acceptance testing in MSTest and SpecFlow. DBTester marks the third generation of this effort (both of the previous generations were client's closed source implementations). In previous implementations there have been functionality for interacting with SQL Server Agent and SQL Server Integration Services revealing my background as a Business Intelligence and Data Warehousing Engineer.

Now where is it going?

My roadmap for DBTester is to work towards a minimally functional yet stable release for version 1.0.0.

A few of the key aspects to have in place are;

  • high test coverage of the library
  • continuous integration and delivery
  • clear documentation on the wiki
  • NuGet packaging
  • Abstract class to support extensions for other databases/techniques

Much of this is already in place via Microsoft DevOps (formally Visual Studio Team Services)

With this in place over the coming month or so (October 2018) - I would then be welcoming the idea of other contributors being involved.

Where can I get it?

First, install NuGet. Then, install DBTester from the package manager console:

PM> Install-Package VulcanAnalytics.DBTester

Do you have an issue?

If you're running into problems, please file an issue here on GitHub at the top of the page.

License, etc.

DBTester source code is Copyright © 2018 Darren Comeau and other contributors under the GNU GPLv3 License.

My promise to you.

Here are a couple of notes about how this project will be maintained;

  • Bugs will always come first, when you report a bug it will be the priority. Hopefully that will mean a rapid bug fix release, else advice on a work around and an estimate for which release the fix will be in.
  • Semantic Versioning will be practiced religiously. You should always be confident that updating to the latest bug or minor release won't cause you an issue.
  • Release notes will include clear details of the changes.
  • Major releases will not be so frequent as to force you to keep reworking your own projects.
  • Major releases will also be supported with bug fixes and new minor features for as long as possible.
Product Compatible and additional computed target framework versions.
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on VulcanAnalytics.DBTester:

Package Downloads
VulcanAnalytics.SpecFlow.DBTester

Database Testing library SpecFlow steps

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-beta5 375 9/22/2019
1.0.0-beta2 554 1/3/2019
1.0.0-beta 612 10/16/2018
0.10.0-alpha 505 10/13/2018
0.9.0-alpha 518 10/12/2018
0.8.0-alpha 507 10/11/2018
0.7.2-alpha 513 10/10/2018
0.7.1-alpha 537 10/9/2018
0.7.0-alpha 510 10/8/2018
0.6.1-alpha 504 10/8/2018
0.6.0-alpha 518 10/3/2018
0.5.1-alpha 559 10/1/2018
0.5.0-alpha 561 9/29/2018
0.4.0-alpha 505 9/28/2018
0.3.0.1-alpha 521 9/27/2018
0.3.0-alpha 588 9/25/2018
0.2.0.1-alpha 557 9/25/2018
0.2.0-alpha 544 9/24/2018
0.1.0.7-alpha 631 9/20/2018

New table methods:
     DropTable will remove the table from your database if it exists
     ClearTable will remove the contents of your table if it is not referenced by other data