Migration Guide

Version 2 to 3

does not contain a definition for 'Then'

1
// BEFORE
2
.Then<TransferInstructionCreatedChapter>();
3
​
4
// NEW
5
.ProceedToChapter<TransferInstructionCreatedChapter>();
Copied!

does not contain a definition for 'That'

1
// BEFORE
2
Scenario.Given.That
3
.An_investor_has_been_created();
4
​
5
// AFTER
6
Scenario.Given
7
.An_investor_has_been_created();
Copied!
​

Version 1 to 2

[CS0246] The type or namespace name 'IScenarioContext' could not be found

Replace all references of IScenarioContext with ScenarioContext

The type arguments for method 'IChapterGiven<..... cannot be inferred

Example this code:
1
public static readonly Func<ScenarioContext, StoryInput, StoryParameters, StoryOuput> AccountTransactionCreated =
2
(context, input, parameters) =>
3
{
4
StoryOutput output = // Do Some work here
5
return ouput;
6
};
Copied!
Should change to:
1
public static readonly Func<ScenarioContext<StoryInput>, StoryParameters, StoryOuput> AccountTransactionCreated =
2
(context, parameters) =>
3
{
4
// Story Input is now accessed through the Scenario Context
5
var storyInput = context.StoryInput;
6
// Do work here
7
StoryOutput output = // Do Some work here
8
return ouput;
9
};
Copied!

Cannot resolve UseResult

1
.UseResult(clientRegistered => newClient = clientRegistered );
Copied!
refactored to:
1
.GetResult(out NewClientRegistered? newClient);
Copied!
Last modified 1yr ago