简体   繁体   中英

Unable to discover NUnit test case

I'm trying use Nunit to test my simple program, but I dont know why it cannot discover my test cases... Compile result is pass

Here are my code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;

namespace ConsoleApplication2
{
    class FizzBuzz
    {
        public static string TestTarget(int parameters)
        {
            return parameters.ToString();
        }
    }
}

and

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;

namespace ConsoleApplication2
{
    class FizzBuzzTest
    {
        [TestFixture]
        public class fizzBuzzTest
        {
            [Test]
            public void TestCase1()
            {
                Assert.That(FizzBuzz.TestTarget(1), Is.EqualTo("1222"));

            }

        }
    }
}

If you are using Nunit 3.* you need to install NUnit3 Test Adapter . For Nunit 2.* - NUnit Test Adapter .

In Visual Studio go to Tools -> Extensions and Update -> Online and find needed adapter.

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