Reputation: 67
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"));
}
}
}
}
Upvotes: 1
Views: 228
Reputation: 5488
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.
Upvotes: 3