Azavea.NijPredictivePolicing.Test.Common.CmdLineJobBaseTests.TestQuotesInArguments C# (CSharp) Method

TestQuotesInArguments() private method

private TestQuotesInArguments ( ) : void
return void
        public void TestQuotesInArguments()
        {
            string[] args = "-somefile \"C:\\terrible path\\with spaces\\in-it\\terrible_filename.txt\" -another param ".Split(' ');

            var dest = new CommandTestObj();
            CmdLineArg[] Arguments = new CmdLineArg[] {
                new CmdLineArg() { Flag = "somefile", DataType=typeof(string), PropertyName="somefile"},
                new CmdLineArg() { Flag = "another", DataType=typeof(string), PropertyName="another"}
            };

            CmdLineJobBase cmds = new CmdLineJobBase();
            Assert.IsTrue(cmds.Load(args, Arguments, dest), "Load failed!");

            Assert.AreEqual("param", dest.another, "parameter after filename with hypens was clobbered");
            Assert.AreEqual("C:\\terrible path\\with spaces\\in-it\\terrible_filename.txt", dest.somefile, "failed on filename with quotes");
        }