c# - SpecFlow 错误 : One or more step definitions are not implemented yet

标签 c# specflow

当我运行单元测试时,我得到:
一个或多个步骤定义尚未实现。
SpecFlowFeature1Steps.GivenIHaveEnteredIntoTheCalculator(50)鉴于我在计算器中输入了 50

最佳答案

我必须从所有方法中删除 ScenarioContext.Current.Pending();:

    [Given(@"I have entered (.*) into the calculator")]
    public void GivenIHaveEnteredIntoTheCalculator(int p0)
    {
        ScenarioContext.Current.Pending(); // remove this
    }

我没有意识到这是导致错误的原因,我认为这是因为缺少步骤定义。

无论如何,留下这个以防将来有人遇到同样的错误。

关于c# - SpecFlow 错误 : One or more step definitions are not implemented yet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48827984/

相关文章:

c# - 使用selectmany时删除 Entity Framework 引用约束错误

c# - 如何使用owin和Mvc 5从httpcontext获取访问 token

c# - 使用 Webinator+Selenium、SpecFlow 和 NUnit 的多浏览器测试

xunit.net - 如何让 SpecFlow 使用 xUnit.net 作为测试运行器

c# - 如何编写相互跟随并共享数据的specflow场景?

c# - 在重写的 void 中运行异步方法

c# - LINQ 的 Count 扩展方法的 SQL 等价物并不明显

c# - 具有复制/粘贴功能的只读 DataGridView?

asp.net-mvc - asp.net mvc/webapi 5 的( headless )集成测试框架