次のようなSpecflowシナリオがあります
Scenario: I Shoot a gun
When I pull the trigger
Then It should expel a bullet from the chamber
私が望んでいるのは、以下のコードのようにこのシナリオを再利用することです
Scenario: I Shoot a gun till there are no bullets left
Given I have a fun with 2 bullets in
And I Shoot a gun
And I Shoot a gun
Then There should be no bullets left in the gun
その瞬間、私はシナリオのすべてのステップを繰り返さなければなりません。私は次のように銃を撃ちます
Scenario: I Shoot a gun till there are no bullets left
Given I have a fun with 2 bullets in
When I pull the trigger
Then It should expel a bullet from the chamber
When I pull the trigger
Then It should expel a bullet from the chamber
Then There should be no bullets left in the gun
上記のシナリオでは、2ステップしか節約できませんが、実際のアプリケーションでは、場合によっては20ステップ以上の書き換えを節約できます。シナリオを呼び出すことができると、読みやすくなり、隠れた手順について心配する必要がなくなると思います。
これはSpecflowで可能ですか?