简体   繁体   中英

OmniSharp unit test not running

Does anyone know why my unit test is not getting picked up? I am using OmniSharp on Visual Studio Code. When I try run the test it says 0 skipped, 0 failed and 0 passed.

using NUnit.Framework;
class Test {

    [SetUp]
    public void Init() {}

    [Test]
    public void calcualteBasket() {

        Package package = new Package(7, 7, 7);
        Package package2 = new Package(20, 20, 20);

        Basket basket = new Basket();
        basket.packages.Add(package);
        basket.packages.Add(package2);

        var finalPrice = package.Price + package2.Price;
        Assert.AreEqual(12, finalPrice);

    }

}

对此不太确定,但您可以尝试公开您的“测试”类,然后运行您的测试。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM