public void TestFullLine() { string[] args = "-s Wyoming -y 2010 -outputFolder \"c:\\sandbox\\ACSDataErmine\\\" -workingFolder \"c:\\sandbox\\ACSDataErmine\\Wo-rking\\\" -v test_vars.txt -exportToShape".Split(' '); ImportJob job = new ImportJob(); if (!job.Load(args)) { Assert.Fail("Couldn't parse standard line for full line"); } Assert.AreEqual(AcsState.Wyoming, job.State, "State is wrong for args"); Assert.AreEqual("test_vars.txt", job.IncludedVariableFile, "variables file is wrong for args"); Assert.AreEqual("c:\\sandbox\\ACSDataErmine\\", job.OutputFolder, "Output folder is wrong!"); Assert.AreEqual("c:\\sandbox\\ACSDataErmine\\Wo-rking\\", job.WorkingFolder, "Working folder is wrong!"); Assert.AreEqual(true.ToString(), job.ExportToShapefile, true.ToString(), "flag param is wrong for args"); }
public void TestStandardLine() { var argsList = new string[][] { ("-s Wyoming -e 150 -v my-VariablesFile.txt -jobName Test-01 " + (char)8211 + "exportToShape").Split(' '), ("-s Wyoming -e 150 " + (char)8211 + "v my-VariablesFile.txt -jobName Test-01 -exportToShape").Split(' '), ((char)8211 + "s Wyoming -e 150 -v my-VariablesFile.txt -jobName Test-01 -exportToShape").Split(' ') }; for (int i = 0; i < argsList.Length; i++) { var args = argsList[i]; ImportJob job = new ImportJob(); if (!job.Load(args)) { Assert.Fail("Couldn't parse standard line for argsList[{0}]", i); } Assert.AreEqual(AcsState.Wyoming, job.State, "State is wrong for argsList[{0}]", i); Assert.AreEqual("my-VariablesFile.txt", job.IncludedVariableFile, "variables file is wrong for argsList[{0}]", i); Assert.AreEqual("Test-01", job.JobName, "Job name is wrong for argsList[{0}]", i); Assert.AreEqual(true.ToString(), job.ExportToShapefile, true.ToString(), "flag param is wrong for argsList[{0}]", i); } }