Jun 6, 2013 at 7:17 AM
Edited Dec 26, 2014 at 1:51 PM
I've tried to implement this before but the code had became cumbersome. My problem was that I wanted to persist the resultset only if the test was failing (When the test is successful, I usually don't care about the result-set and I've test suites with
hundred or thousand of queries so it can be difficult to find one file in such a repository). It meant I needed to delay the decision to persist or not.
At the end I don't know if exactly this feature was working or not (I don't think so but sometimes I'm a bit lazy just to commit).
Anyway, I've a (draft) branch about this but this branch is old and the merge is not trivial.
The idea was to have something like :
<test name="Log in System-under-test">
<query name="Select first product" connectionString="Data Source=.;Initial Catalog=NBi.Testing;Integrated Security=True">
SELECT TOP 2 * FROM Product;
<log condition="only-if-failed" content="resultSet" file="myFilename" />
The log element available in system-under-test and assert.
I'll try to merge tomorrow morning (CET) to give you access to the code base.