Carna

Story Attribute

This attribute specifies a class as a story fixture.

Carna does not search a class (not a nested class) specified by this attribute as a fixture to be run. It can be searched when the member (property or field) is defined using its type.

The available properties are as follows.

Property Description
Description Specifies a description of a fixture.
Fixtures Specifies types of fixtures that are contained by 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.
CanRunParallel Specifies a value that indicates whether child fixtures can be run in parallel. The default value is false.
IsRootFixture Specifies a value that indicates whether this fixture is searched as a fixture to be run. The default value is false.
RequiresSta Specifies a value that indicates whether to run this fixture in a single thread apartment. The default value is false.

For example:

[Feature(
    "Online membership renewal",
    Benefit = "to reduce lost sales from lapsing memberships",
    Role = "Flying High sales manager",
    Feature = "members to be able to renew their membership online"
)]
class OnlineMembershipRenewal
{
    [Story(
        "Providing a secure password when registering",
        Benefit = "to avoid hackers compromising member accounts",
        Role = "the systems administrator",
        Feature = "new members to provide a secure password when they register"
    )]
    class ProvidingSecurePassword
    {
        ...
    }
}
[Feature(
    "Online membership renewal",
    Benefit = "to reduce lost sales from lapsing memberships",
    Role = "Flying High sales manager",
    Feature = "members to be able to renew their membership online"
)]
class OnlineMembershipRenewal
{
    [Story]
    ProvidingSecurePassword Story01 { get; } = default!;
}

[Story(
    "Providing a secure password when registering",
    Benefit = "to avoid hackers compromising member accounts",
    Role = "the systems administrator",
    Feature = "new members to provide a secure password when they register"
)]
class ProvidingSecurePassword
{
    ...
}
[Feature(
    "Online membership renewal",
    typeof(ProvidingSecurePassword),
    Benefit = "to reduce lost sales from lapsing memberships",
    Role = "Flying High sales manager",
    Feature = "members to be able to renew their membership online"
)]
class OnlineMembershipRenewal;

[Story(
    "Providing a secure password when registering",
    Benefit = "to avoid hackers compromising member accounts",
    Role = "the systems administrator",
    Feature = "new members to provide a secure password when they register"
)]
class ProvidingSecurePassword
{
    ...
}
[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 WithdrawCashStory
{
    ...
}