public void TestParamsCommand() { var command = new CommandInterface<StringParamsCommand>(); CollectionAssert.AreEqual( new string[] { "a" }, (string[])(command.Parser.ParseV("a").FunctionArguments[0])); CollectionAssert.AreEqual( new string[] { "a", "b" }, (string[])command.Parser.ParseV("a", "b").FunctionArguments[0]); }
public ConcreteInvoker(CommandInterface l,CommandInterface q){ load = l; quit = q; }
public void TestInvokeClassParameterCommandAsCommandInterface() { var command = new CommandInterface<ClassParameterCommand>(); Assert.AreEqual(6, command.Run(new string[] { "3" })); }
public void Awake(){ g = gameObject.AddComponent<LoadOnClick>(); c = new QuitCommand(g); s = new LoadCommand(g); i= new ConcreteInvoker(s,c); }