I have below method :
public List<ITestKeyword> AddTests(TestEntity testEntity)
{
var DesignSteps = new List<ITestKeyword>();
foreach (var testCase in testEntity.TestCases)
{
DesignSteps.AddRange(testCase.GetTestStepKeywords());
}
return DesignSteps;
}
It is invoked as below:
var listCount= _TestHelper.AddTests(testEntity).Count;
Here is how I try to mock it :
_mockTestHelper
.Setup(s => s.AddTests(It.IsAny<TestEntity>()))
.Returns(It.IsAny<List<ITestKeyword>>());
But it doesn't seem to work. It is throwing null reference exception. I'm not able to figure out. Could anyone please help?