/*******************************************************************************
***  This file is part of Dux Rei Nummariae.                                 ***
***                                                                          ***
***  Copyright (C) 2017, 2018, 2019, 2020, 2021                              ***
***  John Schneiderman <Licensing _AT_ Schneiderman _DOT_ me>                ***
***                                                                          ***
***  This program is free software: you can redistribute it and/or modify it ***
***  under the terms of the GNU Affero General Public License as published   ***
***  by the Free Software Foundation, either version 3 of the License, or    ***
***  (at your option) any later version.                                     ***
***                                                                          ***
***  This program is distributed in the hope that it will be useful, but     ***
***  WITHOUT ANY WARRANTY; without even the implied warranty of              ***
***  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                    ***
***  See the GNU Affero General Public License for more details.             ***
***                                                                          ***
***  You should have received a copy of the GNU Affero General Public License***
***  along with this program. If not, see <http://www.gnu.org/licenses/>.    ***
*******************************************************************************/
#include <QObject>
using ::QObject;
#include <QString>
using ::QString;
#include <QTest>
// using QTEST_MAIN
#include <qt-mocks/Matchers.h>
using qt_mocks::equals;
using qt_mocks::isTrue;
// using QVERIFY_EXCEPTION_THROWN
// using QVERIFY_THAT;

#include <banking/BankName.h>
using drn::banking::BankName;
#include <banking/BankingErrors.h>
using drn::banking::BankError;


namespace drn
{
namespace banking
{
namespace tests
{

struct BankNameUT : QObject
{
	Q_OBJECT

private slots:
	//{ Constructor Tests

	void constructor_empty_ShouldBeDefaults()
	{
		const BankName actual{};
		QVERIFY_THAT(actual.isEmpty(), isTrue());
	}

	void constructor_fullInit_ShouldBeValues()
	{
		const QString expected{"Home Federal"};
		const BankName actual{expected};
		QVERIFY_THAT(actual.institution(), equals(expected));
	}

	void constructor_invalidName_ShouldThrow()
	{
		QVERIFY_EXCEPTION_THROWN(BankName("  "), BankError);
	}

	//}
};

}}}

QTEST_MAIN(drn::banking::tests::BankNameUT)
#include "BankName-unit-tests.moc"
