• Home
  • .NET
  • Unity
  • Godot
  • Design Overview
  • API Documentation
  • Changelog
  • GitHub
Show / Hide Table of Contents
  • Responsible
    • BddExtensions
    • IExternalResultSource
    • IFailureListener
    • IGlobalContextProvider
    • IOptionalTestResponder
    • ITestInstruction<T>
    • ITestOperation<T>
    • ITestResponder<T>
    • ITestScheduler
    • ITestWaitCondition<T>
    • LinqSupport
    • OptionalTestResponder
    • RepetitionLimitExceededException
    • Responsibly
    • TestFailureException
    • TestInstruction
    • TestInstructionExecutor
    • TestInstructionExecutor.StateNotificationCallback
    • TestOperationState
    • TestResponder
    • TestWaitCondition
  • Responsible.Bdd
    • IBddStep
    • Keywords
    • ScenarioBuilder
  • Responsible.Context
    • RunContext
  • Responsible.Docs
    • Inherit
  • Responsible.State
    • ITestOperationState
    • ITestOperationState<T>
    • StateStringBuilder
    • TestOperationStateTransition
    • TestOperationStatus
  • Responsible.Unity
    • TestOperationYieldInstruction<T>
    • UnhandledLogMessageException
    • UnityErrorLogInterceptor
    • UnityFailureListener
    • UnityTestInstructionExecutor
    • UnityTestScheduler
  • Responsible.Utilities
    • IMultipleTaskAwaiter<T>
    • IMultipleTaskSource<T>
    • IndentedStringBuilder<T>
    • RetryingPoller

Class Keywords

Keywords for building BDD-style tests for clearer source code and state strings. Helps in building tests with consistent style.

Inheritance
object
Keywords
Namespace: Responsible.Bdd
Assembly: Responsible.dll
Syntax
public static class Keywords

Fields

Pending

A test instruction representing a BDD test step pending implementation. Will terminate the test as successful early, so that steps after it are skipped. Allows you to quickly write scenarios, and leave the implementation for later.

Declaration
public static readonly ITestInstruction<object> Pending
Field Value
Type Description
ITestInstruction<object>

Methods

And(string, ITestInstruction<object>)

Creates a step that describes additional steps after a Given, When, or Then.

Declaration
public static IBddStep And(string description, ITestInstruction<object> instruction)
Parameters
Type Name Description
string description

Description of the step.

ITestInstruction<object> instruction

Instruction to execute in this step.

Returns
Type Description
IBddStep

The given instruction as a BDD test step.

But(string, ITestInstruction<object>)

Creates a step that describes additional steps after a Given, When, or Then.

Declaration
public static IBddStep But(string description, ITestInstruction<object> instruction)
Parameters
Type Name Description
string description

Description of the step.

ITestInstruction<object> instruction

Instruction to execute in this step.

Returns
Type Description
IBddStep

The given instruction as a BDD test step.

Given(string, ITestInstruction<object>)

Creates a step that describes the initial context of a test.

Declaration
public static IBddStep Given(string description, ITestInstruction<object> instruction)
Parameters
Type Name Description
string description

Description of the step.

ITestInstruction<object> instruction

Instruction to execute in this step.

Returns
Type Description
IBddStep

The given instruction as a BDD test step.

Scenario(string, string, string, int)

Starts building a new BDD-style scenario.

Declaration
public static ScenarioBuilder Scenario(string description, string memberName = "", string sourceFilePath = "", int sourceLineNumber = 0)
Parameters
Type Name Description
string description

Description of the scenario

string memberName

Caller member name provided by compiler. May be overridden for custom operators.

string sourceFilePath

Caller file path provided by compiler. May be overridden for custom operators.

int sourceLineNumber

Source line number provided by compiler. May be overridden for custom operators.

Returns
Type Description
ScenarioBuilder

A scenario builder with the given description.

Then(string, ITestInstruction<object>)

Creates a step that describes an expected outcome of a test.

Declaration
public static IBddStep Then(string description, ITestInstruction<object> instruction)
Parameters
Type Name Description
string description

Description of the step.

ITestInstruction<object> instruction

Instruction to execute in this step.

Returns
Type Description
IBddStep

The given instruction as a BDD test step.

When(string, ITestInstruction<object>)

Creates a step that describes an event or action in a test. This can be a person interacting with the system, or it can be an event triggered by another system.

Declaration
public static IBddStep When(string description, ITestInstruction<object> instruction)
Parameters
Type Name Description
string description

Description of the step.

ITestInstruction<object> instruction

Instruction to execute in this step.

Returns
Type Description
IBddStep

The given instruction as a BDD test step.

In this article
Back to top Generated by DocFX