@@ -12,7 +12,6 @@ namespace NitroxPatcher.Patches.Dynamic;
12
12
[ TestClass ]
13
13
public class CyclopsSonarButton_Update_PatchTest
14
14
{
15
- CyclopsSonarButton_Update_Patch patch = new ( ) ;
16
15
[ TestMethod ]
17
16
public void Sanity ( )
18
17
{
@@ -21,23 +20,23 @@ public void Sanity()
21
20
instructions . Add ( new CodeInstruction ( OpCodes . Callvirt , Reflect . Method ( ( Player player ) => player . GetMode ( ) ) ) ) ;
22
21
instructions . Add ( new CodeInstruction ( OpCodes . Brtrue ) ) ;
23
22
24
- IEnumerable < CodeInstruction > result = CyclopsSonarButton_Update_Patch . Transpiler ( patch . targetMethod , instructions , patch . targetMethod . GetILGenerator ( ) ) ;
23
+ IEnumerable < CodeInstruction > result = CyclopsSonarButton_Update_Patch . Transpiler ( CyclopsSonarButton_Update_Patch . TARGET_METHOD , instructions , CyclopsSonarButton_Update_Patch . TARGET_METHOD . GetILGenerator ( ) ) ;
25
24
Assert . AreEqual ( instructions . Count + 3 , result . Count ( ) ) ;
26
25
}
27
26
28
27
[ TestMethod ]
29
28
public void InjectionSanity ( )
30
29
{
31
- List < CodeInstruction > beforeInstructions = PatchProcessor . GetCurrentInstructions ( patch . targetMethod ) ;
32
- IEnumerable < CodeInstruction > result = CyclopsSonarButton_Update_Patch . Transpiler ( patch . targetMethod , beforeInstructions , patch . targetMethod . GetILGenerator ( ) ) ;
30
+ List < CodeInstruction > beforeInstructions = PatchProcessor . GetCurrentInstructions ( CyclopsSonarButton_Update_Patch . TARGET_METHOD ) ;
31
+ IEnumerable < CodeInstruction > result = CyclopsSonarButton_Update_Patch . Transpiler ( CyclopsSonarButton_Update_Patch . TARGET_METHOD , beforeInstructions , CyclopsSonarButton_Update_Patch . TARGET_METHOD . GetILGenerator ( ) ) ;
33
32
34
33
Assert . IsTrue ( beforeInstructions . Count < result . Count ( ) ) ;
35
34
}
36
35
37
36
[ TestMethod ]
38
37
public void CheckMethodValidity ( )
39
38
{
40
- ReadOnlyCollection < CodeInstruction > instructions = PatchTestHelper . GetInstructionsFromMethod ( patch . targetMethod ) ;
39
+ ReadOnlyCollection < CodeInstruction > instructions = PatchTestHelper . GetInstructionsFromMethod ( CyclopsSonarButton_Update_Patch . TARGET_METHOD ) ;
41
40
for ( int i = 0 ; i < instructions . Count ; i ++ )
42
41
{
43
42
CodeInstruction instruction = instructions [ i ] ;
0 commit comments