dcsimg
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Tip: Unit Test Non-Public Methods in C# Unit Tests

Learn how to expose non-public methods to a test project.


advertisement

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


To expose non-public methods to the test project, you need to mark the assembly with an attribute called InternalsVisibleTo in the asemblyinfo.cs file??

For example:

[assembly: InternalsVisibleTo("testProjectName")]

You need to mark the methods as Internal, and they will available for you to test in the test project.

 

Visit the DevX Tip Bank

 





   
Srinath M. S. says: "I would love to leave a footprint in this flat world."
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Thanks for your registration, follow us on our social networks to keep up-to-date