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?
The TestClass attribute denotes a class that contains unit tests. The TestMethod attribute indicates a method is a test method.
Every test class must have the TestClass attribute, and every test method must have the TestMethod attribute.
A unit test typically features three different phases: Arrange, Act, and Assert (sometimes referred to as AAA). For a unit test to be successful, the resulting behavior in all three phases must be in line with expectations.
Unit testing and Functional testing are the foundation of the testing process. The main difference is between the two is: Unit testing is performed by the developer during the development cycle, and. Functional testing is performed by the tester during the level of system testing.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With