So, It seems I have arrived at an impasse. I have asked to write unit test for a legacy code base in .Net however I am frequently coming across code that is implementing the 'using' statement. This is problem because I am unable to mock the objects.
using (var package1 = new ExcelPackage(sourceHierarchyFile))
{
ExcelWorksheet worksheet = package1.Workbook.Worksheets[0];
var result = _industryBAL.SaveSourceHierarchy(industryId, userEnterpriseId, worksheet);
}
I am using the FakeItEasy mocking framework. But there is no provision for this type of code. Plus Wrapper methods would be one of the options. Basically guys I really need your help since not implementing these is causing an issue in the Code Coverage percentage.