/*
    Copyright (C) 2015 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library 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
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    MA 02110-1301  USA.
*/

#include "siweatherstationtest.h"
#include "moc_siweatherstationtest.cpp"

#include <siweatherstation.h>

#include <QTest>

using namespace SiWeather::Library;

void SiWeatherStationTest::setUuid()
{
	QUuid uuid = QUuid::createUuid();
	SiWeatherStation station;
	station.setUuid(uuid.toString());
	QCOMPARE(station.uuid(), uuid);
}

void SiWeatherStationTest::setName()
{
	QString value = "Station Name";
	SiWeatherStation station;
	station.setName(value);
	QCOMPARE(station.name(), value);
}

void SiWeatherStationTest::setCity(){
	QString value = "Station Name";
	SiWeatherStation station;
	station.setCity(value);
	QCOMPARE(station.city(), value);
}

void SiWeatherStationTest::setLongitude(){
	double coordinate = 12.12345;
	SiWeatherStation station;
	station.setLatitude(coordinate);
	QCOMPARE(station.latitude(), coordinate);
}

void SiWeatherStationTest::setLatitude(){
	double coordinate = 12.12345;
	SiWeatherStation station;
	station.setLongitude(coordinate);
	QCOMPARE(station.longitude(), coordinate);
}

void SiWeatherStationTest::setType(){
	QString value = "Station Type";
	SiWeatherStation station;
	station.setType(value);
	QCOMPARE(station.type(), value);
}

void SiWeatherStationTest::setTypeUrl(){
	QUrl value("http://example.org");
	SiWeatherStation station;
	station.setTypeUrl(value.toString());
	QCOMPARE(station.typeUrl(), value);
}

void SiWeatherStationTest::setEMail(){
	QString value = "test@example.org";
	SiWeatherStation station;
	station.setEMail(value);
	QCOMPARE(station.eMail(), value);
}

void SiWeatherStationTest::constructor()
{
	QUuid uuid = QUuid::createUuid();
	QString name = "Station Name";
	SiWeatherStation station(uuid.toString(), name);
	QCOMPARE(station.uuid(), uuid);
	QCOMPARE(station.name(), name);
}

QTEST_MAIN(SiWeatherStationTest)
