File indexing completed on 2024-07-21 04:35:14

0001 /*
0002     SPDX-FileCopyrightText: 2011 Alvaro Soliverez asoliverez @kde.org
0003 
0004     This file is part of libalkimia.
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 
0009 #include "alkcompanytest.h"
0010 
0011 #include "alkcompany.h"
0012 #include "test.h"
0013 
0014 QTEST_GUILESS_MAIN(AlkCompanyTest)
0015 
0016 void AlkCompanyTest::init()
0017 {
0018 }
0019 
0020 void AlkCompanyTest::cleanup()
0021 {
0022 }
0023 
0024 void AlkCompanyTest::emptyCtor()
0025 {
0026     AlkCompany company;
0027 
0028     QVERIFY(company.symbol().isEmpty());
0029     QVERIFY(company.name().isEmpty());
0030     QVERIFY(company.exchange().isEmpty());
0031     QVERIFY(company.type().isEmpty());
0032     QVERIFY(company.recordId().isEmpty());
0033 }
0034 
0035 void AlkCompanyTest::copyCtor()
0036 {
0037     AlkCompany company;
0038     QString symbol = QString("TESTSYMBOL");
0039     QString name = QString("TESTNAME");
0040     QString exchange = QString("TESTEXCHANGE");
0041     QString type = QString("TESTTYPE");
0042     QString recordId = QString("A1337");
0043 
0044     company.setSymbol(symbol);
0045     company.setName(name);
0046     company.setExchange(exchange);
0047     company.setType(type);
0048     company.setRecordId(recordId);
0049 
0050     AlkCompany copy(company);
0051 
0052     QCOMPARE(copy.symbol(), symbol);
0053     QCOMPARE(copy.name(), name);
0054     QCOMPARE(copy.exchange(), exchange);
0055     QCOMPARE(copy.type(), type);
0056     QCOMPARE(copy.recordId(), recordId);
0057 }
0058 
0059 void AlkCompanyTest::settersAndGetters()
0060 {
0061     AlkCompany company;
0062     QString symbol = QString("TESTSYMBOL");
0063     QString name = QString("TESTNAME");
0064     QString exchange = QString("TESTEXCHANGE");
0065     QString type = QString("TESTTYPE");
0066     QString recordId = QString("A1337");
0067 
0068     company.setSymbol(symbol);
0069     company.setName(name);
0070     company.setExchange(exchange);
0071     company.setType(type);
0072     company.setRecordId(recordId);
0073 
0074     QCOMPARE(company.symbol(), symbol);
0075     QCOMPARE(company.name(), name);
0076     QCOMPARE(company.exchange(), exchange);
0077     QCOMPARE(company.type(), type);
0078     QCOMPARE(company.recordId(), recordId);
0079 }
0080 
0081 void AlkCompanyTest::qDbusArgument()
0082 {
0083 // FIXME: reading from endArg throws a write-only warning and the test fails
0084 }