VulcanAnalytics.DBTester 0.7.2-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.7.2-alpha                
NuGet\Install-Package VulcanAnalytics.DBTester -Version 0.7.2-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.7.2-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add VulcanAnalytics.DBTester --version 0.7.2-alpha                
#r "nuget: VulcanAnalytics.DBTester, 0.7.2-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.7.2-alpha&prerelease

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

DBTester

What is DBTester?

DBTester is a small 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

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=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=True";
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 small today, but increasing (as the database project I'm currently working on requires further unit testing).

  • HasSchema
  • HasTable
  • RowCount
  • InsertData
  • ExecuteStatementWithoutResult
  • ExecuteStatementWithResult

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 is Copyright © 2018 Darren Comeau and other contributors under the GNU GPLv3 License.

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 373 9/22/2019
1.0.0-beta2 552 1/3/2019
1.0.0-beta 610 10/16/2018
0.10.0-alpha 503 10/13/2018
0.9.0-alpha 516 10/12/2018
0.8.0-alpha 505 10/11/2018
0.7.2-alpha 511 10/10/2018
0.7.1-alpha 535 10/9/2018
0.7.0-alpha 508 10/8/2018
0.6.1-alpha 502 10/8/2018
0.6.0-alpha 516 10/3/2018
0.5.1-alpha 557 10/1/2018
0.5.0-alpha 559 9/29/2018
0.4.0-alpha 503 9/28/2018
0.3.0.1-alpha 519 9/27/2018
0.3.0-alpha 586 9/25/2018
0.2.0.1-alpha 555 9/25/2018
0.2.0-alpha 542 9/24/2018
0.1.0.7-alpha 629 9/20/2018

Fixed bug in InsertData method, not handling nulls in data (#19)(reopened)
     More explicit coverage in the null test scenario.