public void ItShouldBePossibleToCreateACommandLneParserAndShowHelp()
 {
     const string helpString = "help";
     var args = new[] { "-test","-help" };
     var eb = new ExitBehaviour();
     var commandLineParser = new CommandLineParser(args, helpString,eb);
     Assert.AreEqual(helpString,commandLineParser.Help);
     Assert.IsTrue(commandLineParser.IsSet("help"));
     Assert.AreEqual(1,eb.ShowHelpCalled);
 }
Ejemplo n.º 2
0
    private void AssignBehaviours()
    {
        // Assigns all cubepad behaviours in the scene
        cubePadBehaviour1 = cubePad1.GetComponentInChildren <CubepadBehaviour>();
        cubePadBehaviour2 = cubePad2.GetComponentInChildren <CubepadBehaviour>();
        cubePadBehaviour3 = cubePad3.GetComponentInChildren <CubepadBehaviour>();

        // Assigns all playerpad behaviours in the scene
        playerPadBehaviour1 = playerPad1.GetComponentInChildren <PlayerpadBehaviour>();
        playerPadBehaviour2 = playerPad2.GetComponentInChildren <PlayerpadBehaviour>();

        // Assigns all exit behaviours in the scene
        exitBehaviour1 = levelExit1.GetComponentInChildren <ExitBehaviour>();
        exitBehaviour2 = levelExit2.GetComponentInChildren <ExitBehaviour>();

        // Sets the original platform positions
        platform1Pos = platform1.transform.position;
        platform2Pos = platform2.transform.position;
    }
        public void ItShouldBePossibleToCheckForValuesPresence()
        {
            const string helpString = "help";
            var args = new[] { "-test", "-gino","-pino","pinoValue" };
            var eb = new ExitBehaviour();
            var commandLineParser = new CommandLineParser(args, helpString, eb);

            Assert.IsTrue(commandLineParser.Has(new []{"test","gino"}));
            Assert.IsFalse(commandLineParser.Has(new[] { "test", "fake" }));
            Assert.IsFalse(commandLineParser.Has(new[] { "fluke", "fake" }));

            Assert.IsTrue(commandLineParser.HasAllOrNone(new[] { "test", "gino" }));
            Assert.IsFalse(commandLineParser.HasAllOrNone(new[] { "test", "fake" }));
            Assert.IsTrue(commandLineParser.HasAllOrNone(new[] { "fluke", "fake" }));

            Assert.IsFalse(commandLineParser.HasOneAndOnlyOne(new[] { "test", "gino" }));
            Assert.IsTrue(commandLineParser.HasOneAndOnlyOne(new[] { "test", "fake" }));
            Assert.IsFalse(commandLineParser.HasOneAndOnlyOne(new[] { "fluke", "fake" }));

            Assert.AreEqual(0, eb.ShowHelpCalled);
        }