简体   繁体   English

如何在 Visual Studio 中一次运行使用 Restharp 和 Web 应用程序编写的 xUnit 集成测试?

[英]how to run xUnit integration tests written using Restharp and web application at a time in visual studio?

I have written integration tests for API using Restsharp and xUnit and i added this test project into existing web API project.我已经使用 Restsharp 和 xUnit 为 API 编写了集成测试,并将这个测试项目添加到现有的 Web API 项目中。 I am not able to run those xUnit integration tests in localhost because it needs application is in run and how can i run both projects (integration tests project and web application project) at a time??我无法在 localhost 中运行那些 xUnit 集成测试,因为它需要应用程序正在运行,我如何才能同时运行两个项目(集成测试项目和 Web 应用程序项目)?

To run API in terminal:在终端中运行 API:

Open cmd.exe , navigate to you API project folder (where .csproj file is).打开cmd.exe ,导航到您的 API 项目文件夹(.csproj 文件所在的位置)。

Run command dotnet run .运行命令dotnet run

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Visual Studio中运行应用程序时如何运行单元测试 - How to run unit tests when running the application in visual studio 如何使用 Visual Studio 2022 构建用 C# 编写的应用程序 - How to build an application written in C#, using Visual Studio 2022 Visual Studio 2022 未运行 XUnit 测试 - Visual Studio 2022 not running XUnit tests 使用xunit框架编写的selenium测试在通过cmd行运行时未被检测到 - selenium tests written using xunit framework not getting detected when run via cmd line 在 Visual Studio 2022 的测试资源管理器中未检测到“未找到要运行的测试”Xunit 测试 - "No tests found to run" Xunit test not detected in Test explorer, Visual Studio 2022 使用 Visual Studio 测试运行器运行的 xUnit 测试的输出未显示在“输出”窗口中 - Output from xUnit tests run with Visual Studio test runner not shown in Output window 如何在不使用 Visual Studio 的情况下直接在 Dockers 容器上运行 ASP.NET Core Web 应用程序 - How to run an ASP.NET Core Web Application on Dockers container directly without using Visual Studio 自定义Visual Studio运行配置以在启动应用程序后运行测试 - Customizing Visual Studio run configuration to run tests after launching application 是否可以使用Visual Studio获得用于集成测试的代码覆盖率数据? - Is it possible to get code coverage data for integration tests using Visual Studio? 当知道 xUnit 并行运行时,使用 xUnit 进行集成测试的策略是什么? - What strategy to use with xUnit for integration tests when knowing they run in parallel?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM