示例#1
0
        public void RelValueCommandTest()
        {
            // arrange
            TestPlugin plugin = GetTestPlugin();
            MethodInfo method = plugin.GetMethodInfo(nameof(TestPlugin.CmdRelValue));

            // act
            bool successful = plugin.Manager.ExecuteCommand(method, new Player(null, null), new[] { "1.2", "~3.4" }, out object result);

            // assert
            Assert.IsTrue(successful);
            Assert.AreEqual("Value: 1.2, Relative: False, Value: 3.4, Relative: True", result);
        }
示例#2
0
        public void StringCommandTest()
        {
            // arrange
            TestPlugin plugin = GetTestPlugin();
            MethodInfo method = plugin.GetMethodInfo(nameof(TestPlugin.CmdString));

            // act
            bool successful = plugin.Manager.ExecuteCommand(method, new Player(null, null), new[] { "text" }, out object result);

            // assert
            Assert.IsTrue(successful);
            Assert.AreEqual("text", result);
        }
示例#3
0
        public void EntityPosCommandTest()
        {
            // arrange
            TestPlugin plugin = GetTestPlugin();
            MethodInfo method = plugin.GetMethodInfo(nameof(TestPlugin.CmdEntityPos));

            // act
            bool successful = plugin.Manager.ExecuteCommand(method, new Player(null, null), new[] { "1.2", "3.4", "~5.6" }, out object result);

            // assert
            Assert.IsTrue(successful);
            Assert.AreEqual("X: 1.2, XRelative: False, Y: 3.4, YRelative: False, Z: 5.6, ZRelative: True", result);
        }