Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docfx Code Doc generation support #2092

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

# DocFx-specific files
_site/
api/

# User-specific files
*.rsuser
*.suo
Expand Down
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TestLibrary>false</TestLibrary>
<NitroxLibrary>false</NitroxLibrary>
<UnityModLibrary>false</UnityModLibrary>
<BuildToolDir>$(SolutionDir)Nitrox.BuildTool\bin\</BuildToolDir>
<BuildToolDir>$(MSBuildThisFileDirectory)Nitrox.BuildTool\bin\</BuildToolDir>
<BuildGenDir>$(BuildToolDir)generated_files\</BuildGenDir>
<BuildGenDllDir>$(BuildGenDir)publicized_assemblies\</BuildGenDllDir>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
killzoms marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -51,7 +51,7 @@
<Choose>
<When Condition="'$(NitroxLibrary)' == 'true'">
<ItemGroup>
<ProjectReference Include="..\Nitrox.Analyzers\Nitrox.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="$(MSBuildThisFileDirectory)Nitrox.Analyzers\Nitrox.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>
Measurity marked this conversation as resolved.
Show resolved Hide resolved
</When>
</Choose>
Expand All @@ -61,11 +61,11 @@
<When Condition="'$(UnityModLibrary)' == 'true'">
<ItemGroup>
<!-- Require other Nitrox projects (that need game DLLs) to wait on BuildTool. -->
<ProjectReference Include="$(SolutionDir)Nitrox.BuildTool\Nitrox.BuildTool.csproj">
<ProjectReference Include="$(MSBuildThisFileDirectory)Nitrox.BuildTool\Nitrox.BuildTool.csproj">
<Name>Nitrox.BuildTool</Name>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)NitroxModel\NitroxModel.csproj">
<ProjectReference Include="$(MSBuildThisFileDirectory)NitroxModel\NitroxModel.csproj">
<Name>NitroxModel</Name>
</ProjectReference>
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions Nitrox.Analyzers/Generators/HarmonyRegisterPatchGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ private static bool IsSyntaxTargetForGeneration(SyntaxNode node)
{
return false;
}

if (type.Members.OfType<MethodDeclarationSyntax>().Any(m => m.AttributeLists.Any(a => a.Attributes.Any(attr => attr.Name.ToString() == "NitroxInLineAttribute"))))
{
return true;
}

// Skip if "Patch" method is already defined.
if (type.Members.OfType<MethodDeclarationSyntax>().Any(m => m.Modifiers.Any(SyntaxKind.OverrideKeyword) && m.Identifier.ValueText == "Patch"))
{
Expand Down
1 change: 1 addition & 0 deletions Nitrox.Analyzers/Nitrox.Analyzers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<!-- Analyzers MUST target netstandard2.0, do not update unless Microsoft (MSDN) says it's possible. -->
<TargetFramework>netstandard2.0</TargetFramework>
<Configurations>Debug;Release;LinuxRelease</Configurations>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions Nitrox.BuildTool/Nitrox.BuildTool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<Nullable>disable</Nullable>
<OutputPath>bin\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<Configurations>Debug;Release;LinuxRelease</Configurations>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.11.4"/>
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\NitroxModel\NitroxModel.csproj"/>
<ProjectReference Include="..\NitroxModel\NitroxModel.csproj" />
</ItemGroup>

</Project>
Expand Down
1 change: 1 addition & 0 deletions Nitrox.Test/Nitrox.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net472</TargetFramework>
<Nullable>disable</Nullable>
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;LinuxRelease</Configurations>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class BaseDeconstructable_Deconstruct_PatchTest
[TestMethod]
public void Sanity()
{
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(BaseDeconstructable_Deconstruct_Patch.TARGET_METHOD);
BaseDeconstructable_Deconstruct_Patch patch = new BaseDeconstructable_Deconstruct_Patch();
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(patch.targetMethod);
IEnumerable<CodeInstruction> transformedIl = BaseDeconstructable_Deconstruct_Patch.Transpiler(null, originalIl);
originalIl.Count().Should().Be(transformedIl.Count() - BaseDeconstructable_Deconstruct_Patch.InstructionsToAdd(true).Count() * 2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ public class BreakableResource_SpawnResourceFromPrefab_PatchTest
[TestMethod]
public void Sanity()
{
ReadOnlyCollection<CodeInstruction> originalIL = PatchTestHelper.GetInstructionsFromMethod(TARGET_METHOD);
IEnumerable<CodeInstruction> transformedIL = Transpiler(TARGET_METHOD, originalIL);
BreakableResource_SpawnResourceFromPrefab_Patch patch = new();
ReadOnlyCollection<CodeInstruction> originalIL = PatchTestHelper.GetInstructionsFromMethod(patch.targetMethod);
IEnumerable<CodeInstruction> transformedIL = Transpiler(patch.targetMethod, originalIL);
originalIL.Count.Should().Be(transformedIL.Count() - 2);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ public class Builder_TryPlace_PatchTest
[TestMethod]
public void Sanity()
{
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(Builder_TryPlace_Patch.TARGET_METHOD);

Builder_TryPlace_Patch patch = new();
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(patch.targetMethod);
IEnumerable<CodeInstruction> transformedIl = Builder_TryPlace_Patch.Transpiler(null, originalIl);
originalIl.Count().Should().Be(transformedIl.Count() - (Builder_TryPlace_Patch.InstructionsToAdd1.Count + Builder_TryPlace_Patch.InstructionsToAdd2.Count));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ConstructableBase_SetState_PatchTest
[TestMethod]
public void Sanity()
{
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(ConstructableBase_SetState_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(new ConstructableBase_SetState_Patch().targetMethod);
IEnumerable<CodeInstruction> transformedIl = ConstructableBase_SetState_Patch.Transpiler(null, originalIl);
originalIl.Count().Should().Be(transformedIl.Count() - ConstructableBase_SetState_Patch.InstructionsToAdd.Count);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Constructable_Construct_PatchTest
[TestMethod]
public void Sanity()
{
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(Constructable_Construct_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(new Constructable_Construct_Patch().targetMethod);
IEnumerable<CodeInstruction> transformedIl = Constructable_Construct_Patch.Transpiler(null, originalIl);
originalIl.Count().Should().Be(transformedIl.Count() - Constructable_Construct_Patch.InstructionsToAdd.Count);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Constructable_DeconstructAsync_PatchTest
[TestMethod]
public void Sanity()
{
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(Constructable_DeconstructAsync_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(new Constructable_DeconstructAsync_Patch().targetMethod);
IEnumerable<CodeInstruction> transformedIl = Constructable_DeconstructAsync_Patch.Transpiler(null, originalIl);
originalIl.Count().Should().Be(transformedIl.Count() - Constructable_DeconstructAsync_Patch.InstructionsToAdd.Count);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using HarmonyLib;
Expand All @@ -24,8 +24,8 @@ public void Sanity()
[TestMethod]
public void InjectionSanity()
{
ReadOnlyCollection<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(ConstructorInput_OnCraftingBegin_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> result = ConstructorInput_OnCraftingBegin_Patch.Transpiler(ConstructorInput_OnCraftingBegin_Patch.TARGET_METHOD, beforeInstructions);
ReadOnlyCollection<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(new ConstructorInput_OnCraftingBegin_Patch().targetMethod);
IEnumerable<CodeInstruction> result = ConstructorInput_OnCraftingBegin_Patch.Transpiler(new ConstructorInput_OnCraftingBegin_Patch().targetMethod, beforeInstructions);

Assert.IsTrue(beforeInstructions.Count < result.Count());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace NitroxPatcher.Patches.Dynamic;
[TestClass]
public class CyclopsSonarButton_Update_PatchTest
{
CyclopsSonarButton_Update_Patch patch = new();
[TestMethod]
public void Sanity()
{
Expand All @@ -20,23 +21,23 @@ public void Sanity()
instructions.Add(new CodeInstruction(OpCodes.Callvirt, Reflect.Method((Player player) => player.GetMode())));
instructions.Add(new CodeInstruction(OpCodes.Brtrue));

IEnumerable<CodeInstruction> result = CyclopsSonarButton_Update_Patch.Transpiler(CyclopsSonarButton_Update_Patch.TARGET_METHOD, instructions, CyclopsSonarButton_Update_Patch.TARGET_METHOD.GetILGenerator());
IEnumerable<CodeInstruction> result = CyclopsSonarButton_Update_Patch.Transpiler(patch.targetMethod, instructions, patch.targetMethod.GetILGenerator());
Assert.AreEqual(instructions.Count + 3, result.Count());
}

[TestMethod]
public void InjectionSanity()
{
List<CodeInstruction> beforeInstructions = PatchProcessor.GetCurrentInstructions(CyclopsSonarButton_Update_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> result = CyclopsSonarButton_Update_Patch.Transpiler(CyclopsSonarButton_Update_Patch.TARGET_METHOD, beforeInstructions, CyclopsSonarButton_Update_Patch.TARGET_METHOD.GetILGenerator());
List<CodeInstruction> beforeInstructions = PatchProcessor.GetCurrentInstructions(patch.targetMethod);
IEnumerable<CodeInstruction> result = CyclopsSonarButton_Update_Patch.Transpiler(patch.targetMethod, beforeInstructions, patch.targetMethod.GetILGenerator());

Assert.IsTrue(beforeInstructions.Count < result.Count());
}

[TestMethod]
public void CheckMethodValidity()
{
ReadOnlyCollection<CodeInstruction> instructions = PatchTestHelper.GetInstructionsFromMethod(CyclopsSonarButton_Update_Patch.TARGET_METHOD);
ReadOnlyCollection<CodeInstruction> instructions = PatchTestHelper.GetInstructionsFromMethod(patch.targetMethod);
for (int i = 0; i < instructions.Count; i++)
{
CodeInstruction instruction = instructions[i];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.ObjectModel;
using System.Collections.ObjectModel;
using System.Linq;
using FluentAssertions;
using HarmonyLib;
Expand All @@ -14,8 +14,8 @@ public class DevConsole_Update_PatchTest
[TestMethod]
public void Sanity()
{
ReadOnlyCollection<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(TARGET_METHOD);
CodeInstruction[] transformedIl = Transpiler(TARGET_METHOD, originalIl.Clone()).ToArray();
ReadOnlyCollection<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(new DevConsole_Update_Patch().targetMethod);
CodeInstruction[] transformedIl = Transpiler(new DevConsole_Update_Patch().targetMethod, originalIl.Clone()).ToArray();
originalIl.Count.Should().Be(transformedIl.Length, "the modified code shouldn't have a difference in size");
transformedIl.Should().NotBeEquivalentTo(originalIl, "the patch should have changed the IL");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using HarmonyLib;
Expand All @@ -23,8 +23,8 @@ public void Sanity()
[TestMethod]
public void InjectionSanity()
{
ReadOnlyCollection<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(Equipment_RemoveItem_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> result = Equipment_RemoveItem_Patch.Transpiler(Equipment_RemoveItem_Patch.TARGET_METHOD, beforeInstructions);
ReadOnlyCollection<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(new Equipment_RemoveItem_Patch().targetMethod);
IEnumerable<CodeInstruction> result = Equipment_RemoveItem_Patch.Transpiler(new Equipment_RemoveItem_Patch().targetMethod, beforeInstructions);

Assert.IsTrue(beforeInstructions.Count < result.Count());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using HarmonyLib;
Expand All @@ -24,7 +24,7 @@ public void Sanity()
[TestMethod]
public void InjectionSanity()
{
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(IngameMenu_QuitGameAsync_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(new IngameMenu_QuitGameAsync_Patch().targetMethod);
IEnumerable<CodeInstruction> result = IngameMenu_QuitGameAsync_Patch.Transpiler(beforeInstructions);

Assert.IsTrue(beforeInstructions.Count() == result.Count()); // The ifs in the target method are all false in the testing environment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -22,8 +22,8 @@ public void Sanity()
[TestMethod]
public void InjectionSanity()
{
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(Inventory_LoseItems_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> result = Inventory_LoseItems_Patch.Transpiler(Inventory_LoseItems_Patch.TARGET_METHOD, beforeInstructions);
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(new Inventory_LoseItems_Patch().targetMethod);
IEnumerable<CodeInstruction> result = Inventory_LoseItems_Patch.Transpiler(new Inventory_LoseItems_Patch().targetMethod, beforeInstructions);

Assert.IsTrue(beforeInstructions.Count() > result.Count());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using FluentAssertions;
Expand All @@ -15,8 +15,8 @@ public class ItemsContainer_DestroyItem_PatchTest
[TestMethod]
public void Sanity()
{
ReadOnlyCollection<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(TARGET_METHOD);
IEnumerable<CodeInstruction> transformedIl = Transpiler(TARGET_METHOD, originalIl);
ReadOnlyCollection<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(new ItemsContainer_DestroyItem_Patch().targetMethod) ;
IEnumerable<CodeInstruction> transformedIl = Transpiler(new ItemsContainer_DestroyItem_Patch().targetMethod, originalIl);
originalIl.Count.Should().Be(transformedIl.Count() - 2);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -22,8 +22,8 @@ public void Sanity()
[TestMethod]
public void InjectionSanity()
{
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(LaunchRocket_OnHandClick_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> result = LaunchRocket_OnHandClick_Patch.Transpiler(LaunchRocket_OnHandClick_Patch.TARGET_METHOD, beforeInstructions);
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(new LaunchRocket_OnHandClick_Patch().targetMethod);
IEnumerable<CodeInstruction> result = LaunchRocket_OnHandClick_Patch.Transpiler(new LaunchRocket_OnHandClick_Patch().targetMethod, beforeInstructions);

// We remove a lot of instructions in this transpiler
Assert.IsTrue(beforeInstructions.Count() > result.Count());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ public void Sanity()
List<CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);
instructions.Add(new CodeInstruction(PDAScanner_Scan_Patch.INJECTION_OPCODE, PDAScanner_Scan_Patch.INJECTION_OPERAND));

IEnumerable<CodeInstruction> result = PDAScanner_Scan_Patch.Transpiler(PDAScanner_Scan_Patch.TARGET_METHOD, instructions);
IEnumerable<CodeInstruction> result = PDAScanner_Scan_Patch.Transpiler(new PDAScanner_Scan_Patch().targetMethod, instructions);

Assert.AreEqual(instructions.Count + 3, result.Count());
}

[TestMethod]
public void InjectionSanity()
{
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(PDAScanner_Scan_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> result = PDAScanner_Scan_Patch.Transpiler(PDAScanner_Scan_Patch.TARGET_METHOD, beforeInstructions);
IEnumerable<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(new PDAScanner_Scan_Patch().targetMethod);
IEnumerable<CodeInstruction> result = PDAScanner_Scan_Patch.Transpiler(new PDAScanner_Scan_Patch().targetMethod, beforeInstructions);

Assert.AreEqual(beforeInstructions.Count() + 3, result.Count());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class SpawnOnKill_OnKill_PatchTest
[TestMethod]
public void Sanity()
{
ReadOnlyCollection<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(TARGET_METHOD);
IEnumerable<CodeInstruction> transformedIl = Transpiler(TARGET_METHOD, originalIl);
ReadOnlyCollection<CodeInstruction> originalIl = PatchTestHelper.GetInstructionsFromMethod(new SpawnOnKill_OnKill_Patch().targetMethod);
IEnumerable<CodeInstruction> transformedIl = Transpiler(new SpawnOnKill_OnKill_Patch().targetMethod, originalIl);
originalIl.Count.Should().Be(transformedIl.Count() - 3);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using HarmonyLib;
Expand All @@ -16,15 +16,15 @@ public void Sanity()
List<CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);
instructions.Add(new CodeInstruction(uGUI_PDA_Initialize_Patch.INJECTION_OPCODE, uGUI_PDA_Initialize_Patch.INJECTION_OPERAND));

IEnumerable<CodeInstruction> result = uGUI_PDA_Initialize_Patch.Transpiler(uGUI_PDA_Initialize_Patch.TARGET_METHOD, instructions);
IEnumerable<CodeInstruction> result = uGUI_PDA_Initialize_Patch.Transpiler(new uGUI_PDA_Initialize_Patch().targetMethod, instructions);
Assert.AreEqual(instructions.Count + 2, result.Count());
}

[TestMethod]
public void InjectionSanity()
{
ReadOnlyCollection<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(uGUI_PDA_Initialize_Patch.TARGET_METHOD);
IEnumerable<CodeInstruction> result = uGUI_PDA_Initialize_Patch.Transpiler(uGUI_PDA_Initialize_Patch.TARGET_METHOD, beforeInstructions);
ReadOnlyCollection<CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(new uGUI_PDA_Initialize_Patch().targetMethod);
IEnumerable<CodeInstruction> result = uGUI_PDA_Initialize_Patch.Transpiler(new uGUI_PDA_Initialize_Patch().targetMethod, beforeInstructions);

Assert.IsTrue(beforeInstructions.Count < result.Count());
}
Expand Down
Loading