[英]C# Visual Studio Unit Tests no Longer run in one repo but does in the other: Same Service Application code
Hi this is more of a conceptual question so sorry I don't think code example will help.嗨,这更像是一个概念性问题,很抱歉,我认为代码示例不会有帮助。
Anyways, we have two different versions of a code in gitlab.无论如何,我们在 gitlab 中有两个不同版本的代码。 The code within the the two builds (master, dev) are the same.两个构建(master,dev)中的代码是相同的。 However the master branch's unit tests won't run.但是主分支的单元测试不会运行。 Again the codes are the same.同样,代码是相同的。 The master branch unit test when you try to debug one test, actually tries to run the entire service application.当您尝试调试一个测试时,主分支单元测试实际上是在尝试运行整个服务应用程序。
On Dev, test tests an indivual test.在 Dev 上,测试测试一个单独的测试。 and debug will debug just the part of the code that is called in the unit test.并且 debug 将仅调试在单元测试中调用的部分代码。
Why could this be happening?为什么会发生这种情况? I get no warnings from VS2019 either我也没有收到来自 VS2019 的警告
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Client;
using System.Collections.Generic;
using Client.Util;
namespace ClientTest
{
[TestClass]
public class ODFSClientTest
{
[TestMethod]
public void TestGetLogFilesInfo()
{
ConstantsUtil constants = new ConstantsUtil();
constants.InitializeConfiguration();
var logFilesInfo = Producer.GetSourceLogFilesInfo();
Assert.AreEqual(7, logFilesInfo.Count);
}
[TestMethod]
public void TestGetSourceLogFilesInfoRTD1240s()
{
ConstantsUtil constants = new ConstantsUtil();
constants.InitializeConfiguration();
var logFilesInfo = Producer.GetSourceLogFilesInfoRTD1240s();
Assert.AreEqual(3, logFilesInfo.Count);
}
I restarted Visual Studio.我重新启动了 Visual Studio。 And that somehow fixed it这以某种方式解决了它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.