<tfoot id='oX9DB'></tfoot>
      <legend id='oX9DB'><style id='oX9DB'><dir id='oX9DB'><q id='oX9DB'></q></dir></style></legend>
    1. <small id='oX9DB'></small><noframes id='oX9DB'>

    2. <i id='oX9DB'><tr id='oX9DB'><dt id='oX9DB'><q id='oX9DB'><span id='oX9DB'><b id='oX9DB'><form id='oX9DB'><ins id='oX9DB'></ins><ul id='oX9DB'></ul><sub id='oX9DB'></sub></form><legend id='oX9DB'></legend><bdo id='oX9DB'><pre id='oX9DB'><center id='oX9DB'></center></pre></bdo></b><th id='oX9DB'></th></span></q></dt></tr></i><div id='oX9DB'><tfoot id='oX9DB'></tfoot><dl id='oX9DB'><fieldset id='oX9DB'></fieldset></dl></div>

        <bdo id='oX9DB'></bdo><ul id='oX9DB'></ul>

    3. VS 2017 中的创建单元测试在哪里?

      Where is Create Unit Test in VS 2017?(VS 2017 中的创建单元测试在哪里?)

    4. <tfoot id='m8TDe'></tfoot>

          <i id='m8TDe'><tr id='m8TDe'><dt id='m8TDe'><q id='m8TDe'><span id='m8TDe'><b id='m8TDe'><form id='m8TDe'><ins id='m8TDe'></ins><ul id='m8TDe'></ul><sub id='m8TDe'></sub></form><legend id='m8TDe'></legend><bdo id='m8TDe'><pre id='m8TDe'><center id='m8TDe'></center></pre></bdo></b><th id='m8TDe'></th></span></q></dt></tr></i><div id='m8TDe'><tfoot id='m8TDe'></tfoot><dl id='m8TDe'><fieldset id='m8TDe'></fieldset></dl></div>

            • <bdo id='m8TDe'></bdo><ul id='m8TDe'></ul>
                <tbody id='m8TDe'></tbody>
              <legend id='m8TDe'><style id='m8TDe'><dir id='m8TDe'><q id='m8TDe'></q></dir></style></legend>
              • <small id='m8TDe'></small><noframes id='m8TDe'>

                本文介绍了VS 2017 中的创建单元测试在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我知道这个问题之前已经在 SO 上提出过,并且似乎这个功能在某个时候从 VS 中删除了.但我正在查看 Microsoft

                但对于针对 .NETCoreApp 1.1 的项目,我没有:

                2018 年 6 月更新

                Microsoft 已注意到 功能请求,并计划在 15.8 版本中为 .NET Core 项目引入上下文菜单选项:

                <块引用>

                Manish Jayaswal [MSFT] 回复 Daniel Tibi · 2018 年 4 月 6 日晚上 10:30

                将此功能添加到 .NET Core 项目需要一些新项目系统的重大变化——驱动 .NET核心项目.这项工作正在项目系统 GitHub 中进行跟踪本期回购(https://github.com/dotnet/project-system/issues/3425).这个问题是不幸的是,预计将在 15.8 发布时间范围内解决,不会为 .NET Core 项目创建单元测试功能在即将发布的 15.7 版本中可用.我们完全理解这是一项关键功能,我们会尽最大努力尽早提供尽可能.

                2018 年 7 月更新

                创建单元使用 Create Unit Tests 命令 页面的测试方法存根具有 been现在更新以反映这不适用于 .NET Core.

                2018 年 8 月更新

                正如下面 @gartenriese 所指出的,微软描述为跟踪这项工作的 GitHub 问题 3425 已移至 2018 年 8 月 2 日 15.9 里程碑.

                2019 年 1 月更新

                单元测试功能似乎依赖于或被 另一部分发展.该部分现在计划用于 VS 16.1,即 VS 2019,并且优先级列表也比 EF Core 3.0(这是 VS 16 的主要功能之一)更靠后根据微软的 David Kean 的这篇 GitHub 帖子.

                2019 年 5 月更新

                面向 .NET Core 和 .NET Standard 的项目(尚)不支持创建单元测试"上下文菜单选项.

                文档已更新以反映这一点 2018 年 7 月 现在声明:

                <块引用>

                创建单元测试菜单命令:

                • 在 Visual Studio 2015 及更高版本的社区版、专业版和企业版中可用.
                • 仅支持以 .NET Framework 为目标的 C# 代码.
                • 可扩展,并支持以 MSTest、MSTest V2、NUnit、xUnit 格式发出测试.
                • 在 .NET Core 项目中尚不可用.

                此功能计划在版本 15.9 中发布的 Visual Studio,但现在 似乎已被推回版本 16.1.

                我已经在 Visual Studio Professional 2019 RC(版本 16.0.0)的 .NET Core 2.2 项目中对此进行了测试,我可以确认它仍然无法正常工作 - 正如上述答案所预期的那样.

                我还刚刚测试了 Visual Studio Professional 2019 预览版(版本 16.1.0 预览版 2.0),它也没有可用,所以看起来微软还没有做到这一点.

                I understand that this question has been asked before on SO and it appears that this feature was removed from VS at some point. But I am looking at a Microsoft tutorial right now and that says there should be a Create Unit Test function in VS 2017.

                I'm trying to test ASP.NET Core MVC controllers. I have followed the steps for creating a test project. But I still can't see any such option when I right click a namespace/class/method.

                EDIT: I'm using Visual Studio 2017 Community Edition

                解决方案

                The answer below relates to .NET Core/Standard only. If you're missing the Create Unit Tests option for a full .NET Framework project see here.

                Current status: It's now working for .NET Core!

                I now have the Create Unit Tests context menu in my Core 3 solution running on Visual Studio Professional 2019 Version 16.3.0 Preview 3.0. Not sure exactly when it reappeared as I've been updating regularly with each new preview version.

                History

                See the updates below for more history and details.

                Original answer June 2017

                This GitHub entry from Microsoft's Jayarani Garg, confirmed it is only available for projects targeting the full .NET framework:

                Jayarani Garg [MSFT] · Feb 27 2017 at 06:09 AM Hi,

                Thank you for your feedback. "Create Unit Test" is currently not supported for .Net Core projects.

                That's by design rather than a bug according to this Visual Studio Team comment on that same Visual Studio Developer Community page:

                Visual Studio Team · Mar 10 2017 at 01:06 PM

                Thank you for your feedback! The Visual Studio team has determined that this issue is not a bug. However, we will consider this feedback and have created https://github.com/Microsoft/vstest/issues/592 to track this. Please feel free to vote for the issue.

                The github issue referred to above on the Microsoft VS Test repo Create Unit Test Context Menu Missing (.net core projects) is slightly confusing. It's asking for this feature to be added for .NET Core projects too but then a Microsoft employees talk about having a fix for an issue. I believe that employee is referring to the old bug where the context menu option wasn't working for full .NET framework projects either as discussed in this question which is also mentioned in that thread. As far as I can see that thread is not saying they've added the menu option for .NET Core projects.

                I've also just checked on a copy of Visual Studio Professional 2017, version 15.2 (26430.6) and I do have the Create Unit Tests option for a project that targets the full .NET framework (this one targets .NET Framework 4.5.1):

                But I don't have it for a project that targets .NETCoreApp 1.1:

                Update June 2018

                Microsoft have taken notice of the upvotes for the feature request and are planning to introduce the context menu option for .NET Core projects in release 15.8:

                Manish Jayaswal [MSFT] replying to Daniel Tibi · Apr 06 2018 at 10:30 PM

                Getting this functionality added to .NET Core projects requires some significant changes in the new project system - which drives the .NET Core projects. This work is getting tracked in project system GitHub repo in this issue (https://github.com/dotnet/project-system/issues/3425) . This issue is expected to be resolved in 15.8 release timeframe so unfortunately, create unit test functionality for .NET Core projects would not be available in the upcoming 15.7 release. We fully understand that this is a key feature and would do our best to make it available as early as possible.

                Update July 2018

                The Create unit test method stubs with the Create Unit Tests command page has been updated now to reflect that this doesn't work for .NET Core.

                Update August 2018

                As pointed out by @gartenriese below, the GitHub issue 3425 Microsoft described as tracking this work was moved to the 15.9 milestone on 02 August 2018.

                Update January 2019

                The unit testing feature seems to be reliant on, or blocked by, another part of the development. That part is now slated for VS 16.1, i.e VS 2019, and is also further down the priority list than EF Core 3.0 (which is one of the main features of VS 16) according to this GitHub post by Microsoft's David Kean.

                May 2019 update

                The Create Unit Tests context menu option isn't supported (yet) for projects that target .NET Core and .NET Standard.

                The documentation was updated to reflect this in July 2018 and now states:

                The Create Unit Tests menu command:

                • Is available in the Community, Professional, and Enterprise Editions of Visual Studio 2015 and later.
                • Supports only C# code that targets the .NET Framework.
                • Is extensible, and supports emitting tests in MSTest, MSTest V2, NUnit, xUnit format.
                • Is not yet available in .NET Core projects.

                This feature was slated for release in Version 15.9 of Visual Studio, but now appears to have been pushed back to Version 16.1.

                I've tested this in a .NET Core 2.2 project in Visual Studio Professional 2019 RC (version 16.0.0) and I can confirm it's still not working there - as expected as per the above answer.

                I've also just tested Visual Studio Professional 2019 Preview (version 16.1.0 Preview 2.0) and it's not available there either, so it doesn't look like Microsoft have got to this yet.

                这篇关于VS 2017 中的创建单元测试在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Force JsonConvert.SerializeXmlNode to serialize node value as an Integer or a Boolean(强制 JsonConvert.SerializeXmlNode 将节点值序列化为整数或布尔值)
                Using JSON to Serialize/Deserialize TimeSpan(使用 JSON 序列化/反序列化 TimeSpan)
                Could not determine JSON object type for type quot;Classquot;(无法确定类型“Class的 JSON 对象类型.)
                How to deserialize a JSONP response (preferably with JsonTextReader and not a string)?(如何反序列化 JSONP 响应(最好使用 JsonTextReader 而不是字符串)?)
                how to de-serialize JSON data in which Timestamp it-self contains fields?(如何反序列化时间戳本身包含字段的JSON数据?)
                JSON.Net custom contract serialization and Collections(JSON.Net 自定义合约序列化和集合)
                    <tbody id='E2MFw'></tbody>
                    <legend id='E2MFw'><style id='E2MFw'><dir id='E2MFw'><q id='E2MFw'></q></dir></style></legend>

                  • <tfoot id='E2MFw'></tfoot>
                    <i id='E2MFw'><tr id='E2MFw'><dt id='E2MFw'><q id='E2MFw'><span id='E2MFw'><b id='E2MFw'><form id='E2MFw'><ins id='E2MFw'></ins><ul id='E2MFw'></ul><sub id='E2MFw'></sub></form><legend id='E2MFw'></legend><bdo id='E2MFw'><pre id='E2MFw'><center id='E2MFw'></center></pre></bdo></b><th id='E2MFw'></th></span></q></dt></tr></i><div id='E2MFw'><tfoot id='E2MFw'></tfoot><dl id='E2MFw'><fieldset id='E2MFw'></fieldset></dl></div>

                        • <bdo id='E2MFw'></bdo><ul id='E2MFw'></ul>
                        • <small id='E2MFw'></small><noframes id='E2MFw'>