我想使用storyQ工作单元测试将此单元测试转换为BDD
[Test]
public async void CreateNewProjectAndDatabase()
{
StartParametersAndAteEngineDlls();
await TheNewDatabaseAndProjectIsCreated();
TheDataBaseViewModelIsCreated();
TheMainViewModelIsCreated();
}
private async Task TheNewDatabaseAndProjectIsCreated()
{
....
}
转换为 BDD
[Test]
public async Task CreateNewProjectAndDatabase()
{
_story.WithScenario("Create a new bla bla")
.Given(StartParametersAndAteEngineDlls)
.When(async ()=> await TheNewDatabaseAndProjectIsCreated())
.Then(TheDataBaseViewModelIsCreated)
.And(TheMainViewModelIsCreated)
.Execute();
}
代码是代码正在编译但是我得到一个 ArgumentException 如果您在方法名称中使用 2 个下划线,请确保有 2 个参数(找到 0)