Early days with unit testing and I'm already struggling ...
Put together a simple test which has a Setup that truncates a target table, then an Assert that after the SSIS task has been run, the expected count of records is in the target table
The setup is a ProcessCommand that runs SQL script via HiddenStart + batch file ...
- I know I could use a SqlCommand, but I wanted to keep the SQL seperate
- mainly so I can work with it in SSMS as I've got Red Gate's SQL Prompt, and I'm addicted to intellisense :-)
So run the test, first time, get a fail as the count isn't right, but check the table in SSMS and the count is right ?
Then re-run any number of times, and the count is right, both in SSISUnit and SSMS
Swop to another test, back to original test, it fails again, but the data is in the target table !!
Appreciate there is probably "something" that I'm not re-setting correctly, but this is such a simple test ... SELECT COUNT(1) FROM TARGETTABLE
And I can run the test, switch to SSMS and see the record is there, so I'm stumped as to quite what is going on ???