/*******************************************************************************
***  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 <pecunia/Codes.h>
using pecunia::currency::Iso4217Codes;
#include <pecunia/Money.h>
using pecunia::currency::Money;
#include <QTest>

#include <map>
using std::map;
#include <string>
using namespace std::string_literals;
using std::string;

#include <budgeting/BudgetSource.h>
using drn::budgeting::BudgetSource;
#include <budgeting/EventFrequency.h>
using drn::budgeting::EventFrequency;
#include <budgeting/Wage.h>
using drn::budgeting::Wage;
#include <budgeting/WageMap.hpp>
using drn::budgeting::WageMap;


namespace drn
{
namespace budgeting
{
namespace tests
{

struct WageMapUT : QObject
{
	Q_OBJECT

private slots:
	// Constructor Tests

	void constructor_Empty_ShouldBeDefaults()
	{
		const WageMap wages{};
		QVERIFY2(wages.empty() == true, "By default there should not be any values.");
	}
	void constructor_FullInit_ShouldBeSupplied()
	{
		const map<BudgetSource, Wage> values{
			{
				BudgetSource{QStringLiteral("Burger King")},
				Wage{
					BudgetSource{QStringLiteral("Burger King")},
					Money{5, 34u, Iso4217Codes::USD},
					EventFrequency::Hourly,
					{9999, 6, 20}
				}
			}
		};
		const WageMap wages{values};
		QCOMPARE(wages.at(BudgetSource{QStringLiteral("Burger King")}), values.at(BudgetSource{QStringLiteral("Burger King")}));
	}

	//}
};

}}}

QTEST_MAIN(drn::budgeting::tests::WageMapUT)
#include "WageMap-unit-tests.moc"
