Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Mar 28, 2019
1 parent f5171b8 commit cac591c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/src/server/wms/test_qgsserver_wms_exceptions.cpp
Expand Up @@ -14,6 +14,7 @@
***************************************************************************/

#include "qgstest.h"
#include "qgswmsparameters.h"
#include "qgswmsserviceexception.h"

/**
Expand All @@ -29,6 +30,7 @@ class TestQgsServerWmsExceptions : public QObject
void cleanupTestCase();

void exception_code();
void exception_message();
};

void TestQgsServerWmsExceptions::initTestCase()
Expand All @@ -53,5 +55,12 @@ void TestQgsServerWmsExceptions::exception_code()
QCOMPARE( exception1.code(), QString( "Error" ) );
}

void TestQgsServerWmsExceptions::exception_message()
{
QgsWms::QgsServiceException::ExceptionCode code = QgsWms::QgsServiceException::QGIS_MISSING_PARAMETER_VALUE;
QgsWms::QgsServiceException exception( code, QgsWms::QgsWmsParameter::LAYER, 400 );
QCOMPARE( exception.message(), QString( "The LAYER parameter is missing." ) );
}

QGSTEST_MAIN( TestQgsServerWmsExceptions )
#include "test_qgsserver_wms_exceptions.moc"

0 comments on commit cac591c

Please sign in to comment.