title: How to teardown a specflow scenario
body: <p>I'm trying to create a new set of tests for testing a legacy web site that I'm working on. The site uses a database at the back end.  I'm planning on using SpecFlow and Selenium, however I'm a bit stumped on what the best way to deal with cleaning up data is.</p>
  
  <p>Currently I have a database backup with a set of sample data which I restore before each test run. This however is cumbersome so I would like to only do this for critical test runs before a release and leave the continuous integration runs working on the same database in between.</p>
  
  <p>Currently I have a large number of tests that go something like this:</p>
  
  <pre><code>Secenario: Test Item Creation
      Given I am logged in
      When I create an item with a unique name
      Then an item exists with the unique name
  </code></pre>
  
  <p>The when step uses a GUID to ensure the name is unique and the then step has access to this via a module variable to check that it exists.</p>
  
  <p>Like I said however I have a lot of tests similar to this and I'm running them multiple times on the same database so the test system is getting stuffed full of items which is slowing down searches and the like.</p>
  
  <p>My question is what is the best way to deal with this? Should I create another step in the test that deletes the item again like this:</p>
  
  <pre><code>Secenario: Test Item Creation
      Given I am logged in
      When I create an item with a unique name
      Then an item exists with the unique name
      Then delete the item with the unique name
  </code></pre>
  
  <p>Or should my test framework somehow be able to deal with this? If so what do people do? Given SpecFlow step's global nature I'd imagine that getting the teardown steps in the correct order if multiple items with parent-child relationships could become problematic.</p>