-
Notifications
You must be signed in to change notification settings - Fork 0
Home
THIS VERSION IN BETA AND IS SUBJECT TO FREQUENT CHANGES/IMPROVEMENTS
Tests Project <PackageReference Include="MemberPeekerGenerator" Version="1.0.2" />
Live Project: <PackageReference Include="MemberPeekerCommon" Version="1.0.3" />
MemberPeekerCommon.CanPeekAttribute
.
In order for the generator to add the files to peek to the compilation, it needs to generate the required MSBuild code. Add the following code to your project:
Where:
[assembly: Xunit.TestFramework("YOUR PROJECT NAME + NAME OF THIS CLASS(.initialize in this case)", "ASSEMBLY NAME")]
Pass the assemblies of the code you want to peek in the AddToCompilation(params Assembly[] assemblies
method.
Example of the generated Directory.Build.Props:
To generate the code for ExampleClass
, you will need to type:
MemberPeeker.ExampleClass_Exposed<ExampleClass>(...Constructor Parameters of ExampleClass)
Breakdown:
-
MemberPeeker
is the namespace required by this generator to access the generated code. -
"CLASS NAME"_Exposed
the_Exposed
part is required. -
<YOUR CLASS>
the type parameter is used by the generator to identify the type
Example:
Original:
Generated (Indentation to be fixed in future release):