1 /************************************************************************
3 ** Copyright (C) 2010 Strahinja Markovic
5 ** This file is part of FlightCrew.
7 ** FlightCrew is free software: you can redistribute it and/or modify
8 ** it under the terms of the GNU Lesser General Public License as published
9 ** by the Free Software Foundation, either version 3 of the License, or
10 ** (at your option) any later version.
12 ** FlightCrew is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ** GNU Lesser General Public License for more details.
17 ** You should have received a copy of the GNU Lesser General Public License
18 ** along with FlightCrew. If not, see <http://www.gnu.org/licenses/>.
20 *************************************************************************/
22 #include <stdafx_tests.h>
23 #include "Validators/Opf/PackageIsRoot.h"
26 using namespace FlightCrew;
28 TEST( PackageIsRootTest, PackageNotRoot_Error )
30 PackageIsRoot validator;
31 std::vector<Result> results = validator.ValidateFile(
32 "test_data/opf_tests/PackageIsRoot_PackageNotRoot.xml" );
34 ASSERT_EQ( results.size(), 1U );
35 EXPECT_EQ( results[ 0 ].GetResultId(), ERROR_OPF_PACKAGE_NOT_ROOT );
36 EXPECT_EQ( results[ 0 ].GetErrorLine(), 2 );
37 EXPECT_EQ( results[ 0 ].GetErrorColumn(), 90 );
40 TEST( PackageIsRootTest, PackageIsRoot_OK )
42 PackageIsRoot validator;
43 std::vector<Result> results = validator.ValidateFile(
44 "test_data/opf_tests/PackageIsRoot_PackageRoot.xml" );
46 ASSERT_EQ( results.size(), 0U );