Carna

Scenario Attribute

This attribute specifies a method as a scenario fixture.

The available properties are as follows.

Property Description
Description Specifies a description of a fixture.
Tag Specifies a tag to filter a fixture.
Benefit Specifies a benefit about a fixture.
Role Specifies a role about a fixture.
Feature Specifies a feature about a fixture.
RequiresSta Specifies a value that indicates whether to run this fixture in a single thread apartment. The default value is false.

For example:

[Story(
    "Account Holder withdraws cash",
    Benefit = "that I can get money when the bank is closed",
    Role = "an Account Holder",
    Feature = "to withdraw cash from an ATM",
    IsRootFixture = true
)]
class WithdrawingCashFromAtm : FixtureSteppable
{
    [Scenario("Account has sufficient funds")]
    void Scenario01()
    {
        Given("the account balance is $100");
        Given("the card is valid");
        Given("the machine contains enough money");
        When("the Account Holder requests $20");
        Then("the ATM should dispense $20");
        Then("the account balance should be $80");
        Then("the card should be returned");
    }
}