Does any one have experience utilizing ready frameworks as specflow with CQRS in BDD.
I liked the approach of Mark Nijhof, however I have already been using SpecFlow for other projects. Can anyone offer a bit of enlightenment, with an example if possible?
I am using it in my current project.
I am using SpecFlow for UI testing (Web client) and for some import tests.
For unit testing, I am using Machine.Specifications.
I think SpecFlow suits the task well. I have support from the requirements expert, the sprint tester and sometimes the project manager in writing specifications which means that I can concentrate on implementing features instead of reading through heavy requirements specifications.
Technically I use CassiniWebDev to host the web client project and simple Process.Start for the NServiceBus endpoints for tests that use the full circle. I use Selenium for the web UI tests and FluentAutomation on top of that. It took a couple of days to set it all up, but it's definitely worth it.
I generate SpecFlow reports, use Pickles to render Features to web and take screen shots with Selenium and publish the entire thing on the project website so that all the stakeholders can see what's going on and what things look like at the moment.
I'd recommend SpecFlow for a BDD/CQRS project.
I have used Machine.Spec for testing CQRS with BDD. From my point of view it worked quite well. For example:
Establish context = () =>
{
// set up your fakes & mocks here...
};
Because of = () =>
{
_bus.Send(_createNewCustomer);
_version++;
};
It should_create_a_customer = () =>
{
_repository.GetById(_id).Id.ShouldEqual(_id);
};
It should_publish_a_customer_Created_event = () =>
{
_subscriber.HandledEvents.Count.ShouldEqual(1);
_subscriber.HandledEvents.First().Value.ShouldBeOfType(typeof(CustomerCreatedEvent));
};
Cleanup Clear_Context = () => _subscriber.HandledEvents.Clear();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With