使用SpecFlow对ADF管道进行单元测试

问题描述 投票:0回答:1

我开始使用SpecFlow来测试我的Azure Data Factory管道。我使用 VS 2019 & .NET Framework 4.7.2。当我尝试运行我的测试时,它开始执行,然后瞬间完成。我还观察到,它没有击中断点,我在 feature file 以及在 binding. 这是我的 packages.config 文件。

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Microsoft.Azure.Management.DataFactory" version="4.8.0" targetFramework="net472" />
  <package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.7" targetFramework="net472" />
  <package id="Microsoft.NET.Test.Sdk" version="15.0.0" targetFramework="net472" />
  <package id="Microsoft.Rest.ClientRuntime" version="2.3.20" targetFramework="net472" />
  <package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.19" targetFramework="net472" />
  <package id="Microsoft.TestPlatform.TestHost" version="15.0.0" targetFramework="net472" />
  <package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net472" />
  <package id="MSTest.TestFramework" version="1.3.2" targetFramework="net472" />
  <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net472" />
  <package id="SpecFlow" version="2.4.0" targetFramework="net472" />
  <package id="SpecRun.Runner" version="3.2.22" targetFramework="net472" />
  <package id="SpecRun.SpecFlow.2-4-0" version="3.2.22" targetFramework="net472" />
  <package id="System.IO" version="4.3.0" targetFramework="net472" />
  <package id="System.Net.Http" version="4.3.4" targetFramework="net472" />
  <package id="System.Runtime" version="4.3.0" targetFramework="net472" />
  <package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net472" />
  <package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net472" />
  <package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net472" />
  <package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net472" />
  <package id="System.ValueTuple" version="4.3.0" targetFramework="net472" />
</packages>

当我检查我的日志文件时,我可以在生成的日志文件中找到这一行。No tests executed (activation needed). 谁能告诉我,我这是哪里出了问题?请注意,我的解决方案是正常构建的。

PFB整个日志,供大家参考。

2020-04-21T23:25:19.8268118+05:30;VSTestExecutionThread;Info;SpecFlow+Runner execution started
2020-04-21T23:25:19.8268118+05:30;VSTestExecutionThread;Info;SpecFlow+Runner 3.2.22 in Framework clr40 in x86 mode execution started
2020-04-21T23:25:19.8268118+05:30;VSTestExecutionThread;Info;TestAdapter Location: C:\Users\ddc\source\repos\ADF.UnitTest\packages\SpecRun.Runner.3.2.22\tools\net45\TechTalk.SpecRun.VisualStudio.TestAdapter.dll
2020-04-21T23:25:20.0532065+05:30;VSTestExecutionThread;Info;SpecRun: running tests in C:\Users\ddc\source\repos\ADF.UnitTest\ADF.UnitTest\bin\Debug\ADF.UnitTest.dll
2020-04-21T23:25:20.0532065+05:30;VSTestExecutionThread;Info;Output folder configured to "C:\Users\ddc\source\repos\ADF.UnitTest\TestResults" (default)
2020-04-21T23:25:20.0542043+05:30;VSTestExecutionThread;Info;Profile: ADF.UnitTest
2020-04-21T23:25:20.1309989+05:30;VSTestExecutionThread;Info;Log file path: C:\Users\ddc\source\repos\ADF.UnitTest\TestResults\ADF.UnitTest_ADF.UnitTest_2020-04-21T232520.log
2020-04-21T23:25:20.1429665+05:30;Thread#14;Info;Checking activation
2020-04-21T23:25:21.6090483+05:30;Thread#14;Error;No tests executed (activation needed)
2020-04-21T23:25:21.6339842+05:30:Total: 0
2020-04-21T23:25:21.6369734+05:30:Succeeded: 0
2020-04-21T23:25:21.6369734+05:30:Ignored: 0
2020-04-21T23:25:21.6369734+05:30:Pending: 0
2020-04-21T23:25:21.6379706+05:30:Skipped: 0
2020-04-21T23:25:21.6379706+05:30:Failed: 0
2020-04-21T23:25:21.6449520+05:30;VSTestExecutionThread;Info;Adding attachments to VSTest
========== End of log file ==========
c# asp.net specflow azure-data-factory-2
1个回答
0
投票

当我更新我的SpecFlow NuGet包时,我也出现了同样的问题。 SpecFlow现在需要你通过微软账户设置一个账户。

在Visual Studio中检查测试的输出,应该有一个激活账户的链接。 请看这里的文档。https:/specflow.org2020introducing-the-specflow-account.

© www.soinside.com 2019 - 2024. All rights reserved.