public void InjectionSanity()
        {
            List <CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(ClipMapManager_HideEntities_Patch.TARGET_METHOD);

            IEnumerable <CodeInstruction> result = ClipMapManager_HideEntities_Patch.Transpiler(ClipMapManager_HideEntities_Patch.TARGET_METHOD, beforeInstructions);

            Assert.IsTrue(beforeInstructions.Count < PatchTestHelper.GetInstructionCount(result));
        }
Esempio n. 2
0
        public void InjectionSanity()
        {
            MethodInfo             targetMethod       = AccessTools.Method(typeof(Constructable), "Construct");
            List <CodeInstruction> beforeInstructions = PatchTestHelper.GetInstructionsFromMethod(targetMethod);

            IEnumerable <CodeInstruction> result = Constructable_Construct_Patch.Transpiler(targetMethod, beforeInstructions);

            Assert.IsTrue(beforeInstructions.Count < PatchTestHelper.GetInstructionCount(result));
        }
Esempio n. 3
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

            instructions.Add(new CodeInstruction(Constructable_Construct_Patch.INJECTION_OPCODE, Constructable_Construct_Patch.INJECTION_OPERAND));

            IEnumerable <CodeInstruction> result = Constructable_Construct_Patch.Transpiler(null, instructions);

            Assert.AreEqual(111, PatchTestHelper.GetInstructionCount(result));
        }
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

            instructions.Add(new CodeInstruction(ClipMapManager_HideEntities_Patch.INJECTION_OPCODE, null));

            IEnumerable <CodeInstruction> result = ClipMapManager_HideEntities_Patch.Transpiler(null, instructions);

            Assert.AreEqual(106, PatchTestHelper.GetInstructionCount(result));
        }