【问题标题】:Integration testing in .net core api 3.1.net core api 3.1 中的集成测试
【发布时间】:2020-08-18 00:37:56
【问题描述】:

我正在尝试为我在 .Net core 3.1 中开发的每个 API 实施集成测试,并遵循 this link 为其创建测试用例。

请找到我为我的 API 创建的以下测试类。

但是在执行时我在这行_server = new TestServer(new WebHostBuilder() .UseStartup<Startup>()); 中遇到错误,如下所示:

我这里有什么遗漏吗?

【问题讨论】:

  • 以后请将您的代码发布为文本,而不是屏幕截图,以便其他人可以找到并复制/粘贴。 :-)

标签: .net asp.net-core .net-core integration-testing asp.net-core-testhost


【解决方案1】:

这不是错误。它实际上是视觉工作室中的一个问题。请参考https://stackoverflow.com/a/52387048/9524580会解决问题

【讨论】:

    猜你喜欢
    • 2021-07-05
    • 1970-01-01
    • 2020-07-08
    • 1970-01-01
    • 2020-06-15
    • 2020-12-10
    • 2022-12-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多