I am trying to run a unit test on a method in an abstract class. I have condensed the code below:
Abstract Class:
public abstract class TestAb
{
public void Print()
{
Console.WriteLine("method has been called");
}
}
Test:
[Test]
void Test()
{
var mock = new Mock<TestAb>();
mock.CallBase = true;
var ta = mock.Object;
ta.Print();
mock.Verify(m => m.Print());
}
Message:
Method is not public
What am I doing wrong here? My goal is to test the methods inside the abstract class using he Moq framework.