7

When i generated unit tests the Visual studio added some fictive class that mocks my class and added the "Shadowing" attribute. What does it do?

Adibe7
  • 3,399
  • 7
  • 28
  • 35

1 Answers1

7

Did some research and found this. Apparantly, the [Shadowing] attribute is used by MSTest when it creates an accessor class that allows you to call a private method on a class as if it were public.

So when you're unit testing a private method of a target class, that private method will be available to you via the accessor wrapper class for the target class.

Tim Cooper
  • 151,519
  • 37
  • 317
  • 271
Jason Evans
  • 28,489
  • 14
  • 89
  • 151