Esempio n. 1
0
        public void TFSUseCaseOptionalPrefix()
        {
            var tcc1 = new Kev_TFS_UseCase();
            var tcc2 = new Kev_TFS_UseCase();
            var clas = new CommandArgumentSupport();

            string[] expectedArgs = new string[] {
                "/BUILDNAME:TFSSupport_DevDesktopPack_Main_Certified_20090423.8",
                "/ATTACHMENT:\"c:\\temp\\list.txt\""
            };

            string[] expectedArgs2 = new string[] {
                "BUILDNAME:TFSSupport_DevDesktopPack_Main_Certified_20090423.8",
                "ATTACHMENT:\"c:\\temp\\list.txt\""
            };

            clas.ArgumentPrefix         = "/";
            clas.ArgumentPostfix        = ":";
            clas.ArgumentPrefixOptional = true;

            clas.ProcessArguments(tcc1, expectedArgs);
            clas.ProcessArguments(tcc2, expectedArgs2);

            Assert.Equal("TFSSupport_DevDesktopPack_Main_Certified_20090423.8", tcc1.BuildName);
            Assert.Equal("\"c:\\temp\\list.txt\"", tcc1.Attachment);

            Assert.Equal(tcc1.BuildName, tcc2.BuildName);
            Assert.Equal(tcc1.Attachment, tcc2.Attachment);
        }
Esempio n. 2
0
        public void TestingKevsUseCase2()
        {
            var    tcc      = new Kev_TFS_UseCase();
            var    clas     = new CommandArgumentSupport();
            string longHelp = clas.GenerateHelp(tcc, "Bugger");

            Assert.True(longHelp.Contains("Bugger"), "The application name was not present in long help");
        }
Esempio n. 3
0
        public void TestingKevsUseCase3()
        {
            var tcc  = new Kev_TFS_UseCase();
            var clas = new CommandArgumentSupport();

            string shortHelp = clas.GenerateShortHelp(tcc, "Bugger");

            Assert.True(shortHelp.Contains("Bugger"), "the application name was not present in long help");
            Assert.True(shortHelp.Contains("Pass the build"), "one of the descriptions did not make it into short help");
            Assert.True(shortHelp.Contains("Pass a filename"), "one of the descriptions did not make it into short help");
        }
Esempio n. 4
0
        public void TFSUseCaseUsesProperties()
        {
            var tcc  = new Kev_TFS_UseCase();
            var clas = new CommandArgumentSupport();

            string[] expectedArgs = new string[] {
                "/BUILDNAME:TFSSupport_DevDesktopPack_Main_Certified_20090423.8",
                "/ATTACHMENT:\"c:\\temp\\list.txt\""
            };

            clas.ArgumentPrefix  = "/";
            clas.ArgumentPostfix = ":";

            clas.ProcessArguments(tcc, expectedArgs);

            Assert.Equal("TFSSupport_DevDesktopPack_Main_Certified_20090423.8", tcc.BuildName);
            Assert.Equal("\"c:\\temp\\list.txt\"", tcc.Attachment);
            b.Info.Log(tcc.Attachment);
        }
Esempio n. 5
0
        public void TFSUseCaseRemainderCheck()
        {
            var tcc  = new Kev_TFS_UseCase();
            var clas = new CommandArgumentSupport();

            string[] expectedArgs = new string[] {
                "/BUILDNAME:TFSSupport_DevDesktopPack_Main_Certified_20090423.8",
                "/ATTACHMENT:\"c:\\temp\\list.txt\"",
                "/Remainder:True",
                "RemainderTwo"
            };

            clas.ArgumentPrefix  = "/";
            clas.ArgumentPostfix = ":";

            clas.ProcessArguments(tcc, expectedArgs);

            Assert.Equal(2, tcc.Remainder.Length);
            Assert.Equal("/Remainder:True", tcc.Remainder[0]);
            Assert.Equal("RemainderTwo", tcc.Remainder[1]);
        }