I am using Visual Studio 2017 and I was trying to create a unit test of a private method in C# (code below):
[TestClass]
public class CalculatorTests
{
[TestMethod]
public void TestCalculator_Hello()
{
var calc = new Calculator(1);
var privateObject = new PrivateObject(calc);
string expected = "hello!";
string result = privateObject.Invoke("HelloTest");
Assert.AreEqual(expected, result);
}
}
However, I got this error message:
Error CS0246 The type or namespace name 'PrivateObject' could not be found
I've looked up for articles and tutorials but I still don't know what I am doing wrong.