InternalsVisibleTo

Dear Future Jamie:

When you want to test private methods, do this:

1) Change the scope from private to internal

2) Add this attribute to the namespace of the class that has the private method:

[assembly: InternalsVisibleTo(“NameSpace.Class.Tests”)]

3) Add this using statement to the class that has #2 in it:

using System.Runtime.CompilerServices;

 

Love,

Past Jamie

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: