1 // xestiaab_convert.h - Xestia Address Book Convert Unit Tests.
3 // (c) 2012-2015 Xestia Software Development.
5 // This file is part of Xestia Address Book.
7 // Xestia Address Book is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by the
9 // Free Software Foundation, version 3 of the license.
11 // Xestia Address Book is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with Xestia Address Book. If not, see <http://www.gnu.org/licenses/>
19 #include <gtest/gtest.h>
20 #include "../convert.h"
22 TEST(ConvertCmdLine, ConvertTests){
24 // Test that the import format is valid.
26 ASSERT_EQ(CONVERTRESULT_OK, ConvertContact(wxT("vCard4"),
28 wxT("LoadCheck-Load1.vcf"),
29 wxT("LoadCheck-Load1-v3Conv.vcf")));
30 ASSERT_EQ(CONVERTRESULT_OK, ConvertContact(wxT("vCard3"),
32 wxT("LoadCheck-Load1.vcf"),
33 wxT("LoadCheck-Load1-v3Conv.vcf")));
35 // Test that a matching import and export formats return
38 ASSERT_EQ(CONVERTRESULT_FORMATSSAME, ConvertContact(wxT("vCard3"),
40 wxT("LoadCheck-Load1.vcf"),
41 wxT("LoadCheck-Load1-v3Conv.vcf")));
43 // Test that an invalid import format returns an error.
45 ASSERT_EQ(CONVERTRESULT_INVALIDIMPORTFORMAT, ConvertContact(wxT("vCardNope"),
47 wxT("LoadCheck-Load1.vcf"),
48 wxT("LoadCheck-Load1-v3Conv.vcf")));