Skip to main content
Version: shouty

Take a look around

1. Get familiar with the project​

Now that you've cloned the Shouty project let's have a look around. There are only a few files here. Use the following diagram to help you decide what each file in the project is doing.

Try to match the files in the project to the shapes on the diagram.

  • Feature File: Where we write our Given/When/Then scenarios.
  • Step Definitions: Test code that connects to our Gherkin scenarios.
  • Application Code: The heart of our project, the business logic.
  • Unit Tests: Programmer tests that verify our code.

2. Answer the questions​

Question #1​

Which files correspond to the shapes on the diagram?

Show answer
Key PieceLocation
Application CodeShouty.cs
Unit TestsShoutyTest.cs
Feature Fileshout.feature
Step DefinitionsShoutSteps.cs

Question #2​

The feature file contains scenarios made up of steps. Each step causes SpecFlow to look for a matching Loading... step definition to run. How does SpecFlow decide which step definition to run for each step?

Show answer

Step-definitions are denoted by C# attributes:

[Given(@"Lucy is at {int}, {int}")]

Which match steps in the Gherkin like:

Given Lucy is at 0, 0

3. Discuss​

DISCUSS

Are there any files whose reason for existing is not clear? Which ones?