예제 #1
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

            instructions.Add(new CodeInstruction(Equipment_RemoveItem_Patch.INJECTION_OPCODE));

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

            Assert.AreEqual(108, result.Count());
        }
예제 #2
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

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

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

            Assert.AreEqual(instructions.Count + 3, result.Count());
        }
예제 #3
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

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

            IEnumerable <CodeInstruction> result = BuilderTool_HandleInput_Patch.Transpiler(BuilderTool_HandleInput_Patch.TARGET_METHOD, instructions);

            Assert.AreEqual(instructions.Count + 5, result.Count());
        }
예제 #4
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));
        }
예제 #5
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

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

            IEnumerable <CodeInstruction> result = ConstructableBase_SetState_Patch.Transpiler(ConstructableBase_SetState_Patch.TARGET_METHOD, instructions);

            Assert.AreEqual(instructions.Count + 2, result.Count());
        }
예제 #6
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

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

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

            Assert.AreEqual(instructions.Count + 3, result.Count());
        }
        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(instructions.Count + 3, result.Count());
        }
예제 #8
0
    public void Sanity()
    {
        List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

        instructions.Add(new CodeInstruction(OpCodes.Call, IngameMenu_QuitGameAsync_Patch.triggerOperand));

        IEnumerable <CodeInstruction> result = IngameMenu_QuitGameAsync_Patch.Transpiler(instructions);

        Assert.AreEqual(instructions.Count, result.Count());
    }
예제 #9
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

            instructions.Add(new CodeInstruction(Builder_TryPlace_Patch.PLACE_BASE_INJECTION_OPCODE, Builder_TryPlace_Patch.PLACE_BASE_INJECTION_OPERAND));
            instructions.Add(new CodeInstruction(Builder_TryPlace_Patch.PLACE_FURNITURE_INJECTION_OPCODE, Builder_TryPlace_Patch.PLACE_FURNITURE_INJECTION_OPERAND));

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

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

            instructions.Add(new CodeInstruction(CrashedShipExploder_Update_Patch.INJECTION_OPCODE, CrashedShipExploder_Update_Patch.INJECTION_OPERAND));
            instructions.Add(new CodeInstruction(OpCodes.Brfalse));

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

            Assert.AreEqual(instructions.Count + 2, result.Count());
        }
예제 #11
0
        public void Sanity()
        {
            List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

            instructions.Add(new CodeInstruction(Constructable_Construct_Patch.AMOUNT_CHANGED_INJECTION_OPCODE, Constructable_Construct_Patch.AMOUNT_CHANGED_INJECTION_OPERAND));
            instructions.Add(new CodeInstruction(Constructable_Construct_Patch.CONSTRUCTION_COMPLETE_INJECTION_OPCODE, Constructable_Construct_Patch.CONSTRUCTION_COMPLETE_INJECTION_OPERAND));

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

            Assert.AreEqual(112, result.Count());
        }
예제 #12
0
    public void Sanity()
    {
        List <CodeInstruction> instructions = PatchTestHelper.GenerateDummyInstructions(100);

        instructions.Add(new CodeInstruction(CyclopsSonarButton_Update_Patch.INJECTION_OPCODE, CyclopsSonarButton_Update_Patch.INJECTION_OPERAND));
        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(null, instructions);

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