本文介绍了SpecFlow“生成测试定义"VS2015 中缺少上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试用 VS2015 并编写 SpecFlow 功能文件.当我右键单击文件时,我找不到生成测试定义"上下文菜单.这只发生在类库(包)"中,显然是 DNX 5.0 库.

I'm trying out VS2015 and writing SpecFlow feature files. When I right click on the file, I cannot find "Generate Test Definitions" context menu. This happens only in "Class Library (Package)" which is obviously DNX 5.0 library.

这是我的 project.json:

Here is my project.json:

{
    "version": "1.0.0-*",
    "description": "",
    "authors": [ "" ],
    "tags": [ "" ],
    "projectUrl": "",
    "licenseUrl": "",

    "dependencies": {
        "SpecFlow": "1.9.0",
        "SpecFlow.xUnit": "1.0.2",
        "xunit": "2.1.0-beta3-build3029",
        "xunit.extensions": "2.0.0"
    },

    "frameworks": {
        "dnx451": { },
        "dnxcore50": {
        "dependencies": {
            "System.Collections": "4.0.10-beta-22816",
            "System.Linq": "4.0.0-beta-22816",
            "System.Threading": "4.0.10-beta-22816",
            "Microsoft.CSharp": "4.0.0-beta-22816"
        }
    }
}

并且我添加了 SpecFlow Visual Studio 2015 扩展.

And I have added SpecFlow Visual Studio 2015 extensions.

我在这里遗漏了什么吗?

Am I missing something here?

但是如果我在一个正常的类库中尝试同样的方法.

But if I try the same in a normal Class Library that works fine.

推荐答案

在 Specflow 解决这个问题之前,我发现这个小宝石可以提供一个很好的桥梁:

I found this little gem to provide a good bridge until Specflow sorts out this issue:

https://github.com/stajs/SpecFlow.Dnx

请务必阅读自述文件!

这篇关于SpecFlow“生成测试定义"VS2015 中缺少上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 20:16