0

In one of our Legacy project we have a class as below:

public class DataView : ScElement, IInternalDefinition, IIntertab

also contains , static constructor , static properties and static methods along with instance methods and properties.

what are some possible ways to mock this class ? Is writing a wrapper possible as this class follows Multiple inheritance?

Tried using Moq and NSubstitute mocking frameworks but could not identify how to also looked at writing a wrapper but is confused.

fopa
  • 23
  • 5
  • you simply can't mock a static dependency. You may only write tests that also use the static dependency, make the tests go green, refactor, test again. – MakePeaceGreatAgain Nov 24 '22 at 09:36
  • Does this answer your question? [Mocking Static Methods](https://stackoverflow.com/questions/5864076/mocking-static-methods) – Martin Costello Nov 24 '22 at 09:37

0 Answers0