Library for easily swapping in real data stores in your tests!
Hi all,
I'm hoping some members of the Spec Flow community will find this useful.
I've been using SpecFlow with asp.net Web api for quite a while across different projects. An issue I've run into a few times is getting an agreement whether the tests should be using a "real" data layer or an in memory mocked data layer.
I won't go into detail on the pros and cons for making that choice here as you probably already know, but I'm here to offer something that you may find useful.
In order to solve this problem I've written an open source library, called TestDataDefinitionFramework which provides a layer of abstraction between the step definitions/test data setup and the underlying data store.
By interacting with the abstraction you can then choose at compile time or runtime whether you'd like to stand up a real repository or simply run in memory.
So far I've built two plugins for this, one for MongoDB and one for MSSQL. When invoked these plugins can setup a Docker container, and create a database/collection based on your test data so that your SUT can interact with this server and test your provider integration.
Have a read of the Github pages if you'd like to find out more, https://github.com/craigwardman/TestDataDefinitionFramework
Or you can install these packages via NuGet.
Hope someone can benefit from this and maybe we can grow the number of plugins to add more data stores to the list!
Cheers, Craig.
0
Please sign in to leave a comment.
Comments
0 comments