私はそのような機能ファイルを持っています:
Feature: Viewing revenue
Background:
Given invoices
| Date | Amount |
| 1/1/2010 | 200 |
| 1/1/2011 | 300 |
Scenario: Total revenue
Then the total revenue is
| Label | Revenue |
| | $500 |
Scenario: Total revenue by year
When I choose to view it by "Year"
Then the total revenue is
| Label | Revenue |
| 2010 | $200 |
| 2011 | $300 |
各シナリオの実行後にクリーンアップコードを実行したいと思います。次のように、AfterScenario属性で装飾された関数があります。
let [<AfterScenario>] ``Drop Invoices`` () =
Invoices.removeAll
関数は呼び出されますが、一度だけ、そしてNUnitのGUIランナーを介してプロジェクトをリロードしたときにのみ呼び出されます。プロジェクトをリロードせずにテストを実行しても、関数は呼び出されません。