From cef12f62746e5b56eae472f5ba2cf33e392159c2 Mon Sep 17 00:00:00 2001 From: Jon Manning Date: Thu, 23 May 2024 13:19:25 +1000 Subject: [PATCH] Add additional failure tests for variadic commands --- .../DialogueRunnerTests/DialogueRunnerTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs b/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs index 4fde5521..48ce29d0 100644 --- a/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs +++ b/Tests/Runtime/DialogueRunnerTests/DialogueRunnerTests.cs @@ -426,6 +426,18 @@ public void HandleCommand_DispatchesCommandsWithVariadicParameters(string comman Assert.AreEqual(CommandDispatchResult.StatusType.Succeeded, result.Status); } + [TestCase("testInstanceVariadic DialogueRunner 1 one")] + [TestCase("testInstanceVariadic DialogueRunner 1 true too")] + [TestCase("testStaticVariadic 1 one")] + [TestCase("testStaticVariadic 1 true too")] + public void HandleCommand_InvalidVariadicParameters_ShouldFail(string command) + { + var dispatcher = runner.CommandDispatcher; + + var result = dispatcher.DispatchCommand(command, runner); + + Assert.AreEqual(CommandDispatchResult.StatusType.InvalidParameter, result.Status); + } [Test] public void AddCommandHandler_RegistersCommands()