VulcanAnalytics.DBTester
0.5.1-alpha
See the version list below for details.
dotnet add package VulcanAnalytics.DBTester --version 0.5.1-alpha
NuGet\Install-Package VulcanAnalytics.DBTester -Version 0.5.1-alpha
<PackageReference Include="VulcanAnalytics.DBTester" Version="0.5.1-alpha" />
paket add VulcanAnalytics.DBTester --version 0.5.1-alpha
#r "nuget: VulcanAnalytics.DBTester, 0.5.1-alpha"
// Install VulcanAnalytics.DBTester as a Cake Addin #addin nuget:?package=VulcanAnalytics.DBTester&version=0.5.1-alpha&prerelease // Install VulcanAnalytics.DBTester as a Cake Tool #tool nuget:?package=VulcanAnalytics.DBTester&version=0.5.1-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
- ExecuteStatementWithoutResult
- InsertData
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 | Versions 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. |
-
- Microsoft.SqlServer.SqlManagementObjects (>= 140.17283.0)
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 | 502 | 10/13/2018 |
0.9.0-alpha | 515 | 10/12/2018 |
0.8.0-alpha | 504 | 10/11/2018 |
0.7.2-alpha | 510 | 10/10/2018 |
0.7.1-alpha | 534 | 10/9/2018 |
0.7.0-alpha | 507 | 10/8/2018 |
0.6.1-alpha | 501 | 10/8/2018 |
0.6.0-alpha | 515 | 10/3/2018 |
0.5.1-alpha | 556 | 10/1/2018 |
0.5.0-alpha | 558 | 9/29/2018 |
0.4.0-alpha | 502 | 9/28/2018 |
0.3.0.1-alpha | 518 | 9/27/2018 |
0.3.0-alpha | 585 | 9/25/2018 |
0.2.0.1-alpha | 554 | 9/25/2018 |
0.2.0-alpha | 541 | 9/24/2018 |
0.1.0.7-alpha | 628 | 9/20/2018 |
Remove two second timeout on database connections, use timeout value specified in connection strings.