public void Test_getQgisResultGeojson_returns_empty_string_when_pelnumate_line_is_same_as_message()
        {
            Random       random           = new Random();
            string       messageParameter = "message" + random.Next();
            ResultObject resultObject     = new ResultObject("test", "test \n" + messageParameter + "\n");

            ScriptOutputHandler scriptOutputHandler = new ScriptOutputHandler();
            string result = scriptOutputHandler.getQgisResultGeojson(resultObject, messageParameter);

            Assert.AreEqual("", result);
        }
        public void Test_getQgisResultGeojson_gets_pelnumate_line_when_that_line_is_defined()
        {
            Random       random         = new Random();
            string       expectedResult = "result" + random.Next();
            ResultObject resultObject   = new ResultObject("test", "test \n" + expectedResult + "\n");

            ScriptOutputHandler scriptOutputHandler = new ScriptOutputHandler();
            string result = scriptOutputHandler.getQgisResultGeojson(resultObject, "bad" + random.Next());

            Assert.AreEqual(expectedResult, result);
        }
        public void Test_getQgisResultGeojson_message_in_pelnumate_line_is_swapped_with_empty_string()
        {
            Random       random           = new Random();
            string       expectedResult   = "result" + random.Next();
            string       messageParameter = "message" + random.Next();
            ResultObject resultObject     = new ResultObject("test", "test \n" + expectedResult + messageParameter + "\n");

            ScriptOutputHandler scriptOutputHandler = new ScriptOutputHandler();
            string result = scriptOutputHandler.getQgisResultGeojson(resultObject, messageParameter);

            Assert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 4
0
        public HandleOutput()
        {
            //qgisHandler = new OnQgisSuccess();
            //AbstractChain h2 = new OnQgisFailure();

            //qgisHandler.SetSuccessor(h2);

            // gdalHadnler = new OnGdalSuccess();
            //AbstractChain hd2 = new OnGdalFailure();

            //gdalHadnler.SetSuccessor(hd2);
            gdalHadnler = new LibraryOutputHandler();
            qgisHandler = new ScriptOutputHandler();
        }