Exemple #1
0
        public void Test_HandleResponse_error_message(string message, string expectedMessage)
        {
            Random       random       = new Random();
            ResultObject resultObject = new ResultObject("ERROR " + message + random.Next(), "");

            LibraryOutputHandler libraryOutputHandler = new LibraryOutputHandler();

            BadRequestObjectResult result = (BadRequestObjectResult)libraryOutputHandler.HandleResponse(resultObject, "");

            Assert.AreEqual("{ errors = " + expectedMessage + " }", result.Value.ToString());
        }
Exemple #2
0
        public void Test_HandleResponse_error_code_400(string message, int code)
        {
            Random       random       = new Random();
            ResultObject resultObject = new ResultObject("ERROR " + message + random.Next(), "");

            LibraryOutputHandler libraryOutputHandler = new LibraryOutputHandler();

            BadRequestObjectResult result = (BadRequestObjectResult)libraryOutputHandler.HandleResponse(resultObject, "");

            Assert.AreEqual(code, result.StatusCode);
        }
Exemple #3
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();
        }