0

I have a C# application that uses a lot of

1 ) private

2 ) static

3) return type of void

methods which is difficult to unit test.

I can use Microsoft.VisualStudio.TestTools.UnitTesting.PrivateType objects, and then use the InvokeStatic to call the aforementioned methods.

However, could someone please tell me if there is way to check value of the local variables within the aforementioned private static void methods?

crazyTech
  • 1,379
  • 3
  • 32
  • 67
  • 1
    Probably the correct answer to this is to re-write those objects to be more unit-testable - but that probably isn't what you're looking for! – James Harcourt Mar 11 '19 at 13:30
  • Thx for response, but rewriting the "System under Test" is Not possible for the project. – crazyTech Mar 11 '19 at 13:32

0 Answers0