VulcanAnalytics.DBTester 1.0.0-beta5

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

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

DBTester

NuGet

Changelog

License

Join the chat at https://gitter.im/VulcanAnalytics-DBTester/Lobby

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
  • Basic implementation of another database as proof of concept

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.

If you have any questions regarding the license please refer to this issue and feel free to get in touch.

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 based on Keep a Changelog.
  • 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 net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  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 359 9/22/2019
1.0.0-beta2 544 1/3/2019
1.0.0-beta 597 10/16/2018
0.10.0-alpha 489 10/13/2018
0.9.0-alpha 501 10/12/2018
0.8.0-alpha 490 10/11/2018
0.7.2-alpha 495 10/10/2018
0.7.1-alpha 519 10/9/2018
0.7.0-alpha 493 10/8/2018
0.6.1-alpha 486 10/8/2018
0.6.0-alpha 500 10/3/2018
0.5.1-alpha 541 10/1/2018
0.5.0-alpha 544 9/29/2018
0.4.0-alpha 487 9/28/2018
0.3.0.1-alpha 503 9/27/2018
0.3.0-alpha 571 9/25/2018
0.2.0.1-alpha 536 9/25/2018
0.2.0-alpha 525 9/24/2018
0.1.0.7-alpha 610 9/20/2018

Beta Release

     ## [1.0.0-beta5] - 2019-09-22
     ### Added
     - `QuotedIdentifier` method will add square brackets to text so that spaces in names are handled correctly @darrencomeau
     - `UnquotedIdentifier` method will strip square brackets from text so that a quoted object can be used when these are not used/needed @darrencomeau
     ### Changed
     - Error message includes SQL statement for any direct or indirect calls to `ExecuteStatementWithoutResult` which fail @darrencomeau
     ### Fixed
     - `RowCount` method handles object names with spaces in [@darrencomeau](https://github.com/VulcanAnalytics/DBTester/issues/49)
     - `ClearTable` method handles object names with spaces in [@darrencomeau](https://github.com/VulcanAnalytics/DBTester/issues/51)
     - `InsertData` method handles schema, object, and column names with spaces in [@darrencomeau](https://github.com/VulcanAnalytics/DBTester/issues/53)
     - `InsertData` method handles date/time columns [@darrencomeau](https://github.com/VulcanAnalytics/DBTester/issues/52)

     Full [changelog](https://github.com/VulcanAnalytics/DBTester/blob/master/CHANGELOG.md)