Why does visual studio 2012 not find my tests?

后端 未结 30 3220
盖世英雄少女心
盖世英雄少女心 2020-12-07 10:51

I have some tests that use the built in Microsoft.VisualStudio.TestTools.UnitTesting, but can not get them to run.

I am using visual studio 2012 ultimat

30条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 11:26

    Please add the keyword public to your class definition. Your test class is currently not visible outside its own assembly.

    namespace tests {
        [TestClass]
        public class SimpleTest {
            [TestMethod]
            public void Test() {
                Assert.AreEqual("a","a", "same");
            }
        }
    }
    

提交回复
热议问题