Trying to create unit tests for my methods and can’t seem to get the configuration right.
I go New Test -> Unit Test Wizard -> Pick my method -> fill in test method values but I always get Assert.Inconclusive failed. Verify the correctness of this test method.
Here is a sample method:
namespace ConsoleApplication
{
class Program
{
static void Main(string[] args)
{
}
public int Mult(int a, int b)
{
return a * b;
}
}
}
and the test method:
[TestMethod()]
public void MultTest()
{
Program target = new Program(); // TODO: Initialize to an appropriate value
int a = 4; // TODO: Initialize to an appropriate value
int b = 5; // TODO: Initialize to an appropriate value
int expected = 20; // TODO: Initialize to an appropriate value
int actual;
actual = target.Mult(a, b);
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
Seems straight forward enough, but am I missing something trivial?
sure you do :
Your test says inconclusive therfore the result of the test is inconclusive.. You should use this syntax “Assert.Inconclusive” only to cover edge cases you are really aware of.
AFAIC, I never use it.