/***************************************************************************
 * tabbendtest.cpp
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2004-2007 the KTabEdit development team <mrgwen@gmail.com>
 ***************************************************************************/

/***************************************************************************
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * See the file COPYING for more information.
 ***************************************************************************/

#include "tabbendtest.h"

#include "src/header.h"

#include "src/tablature/tabbeateffects.h"
#include "src/tablature/tabchord.h"
#include "src/tablature/tabduration.h"

#include "src/tablature/tabbend.h"
#include "src/tablature/tabdynamic.h"

#include "src/tablature/tabgracenotetransition.h"
#include "src/tablature/tabgracenote.h"

#include "src/tablature/tabharmonic.h"
#include "src/tablature/tabslide.h"
#include "src/tablature/tabtrill.h"
#include "src/tablature/tabnoteeffect.h"

#include "src/tablature/tabnote.h"

#include "src/tablature/tabmixtablechanges.h"
#include "src/tablature/tabtimes.h"
#include "src/tablature/tabbarproperties.h"

#include "src/tablature/tabbar.h"

#include "src/tablature/trackmidiproperties.h"
#include "src/tablature/timesignature.h"
#include "src/tablature/trackproperties.h"

#include "src/tablature/tabtrack.h"

#include "src/tablature/songkey.h"
#include "src/tablature/tablyrics.h"
#include "src/tablature/tabproperties.h"

#include "src/tablature/tabsong.h"

void TabBendTest::testBendType()
{
	TabBend bend;
	QCOMPARE( bend.bendType(), TabBend::NoneBend );
	
	bend.setBendType(TabBend::Bend);
	QCOMPARE( bend.bendType(), TabBend::Bend );
}

void TabBendTest::testBendValue()
{
	TabBend bend;
	QCOMPARE( bend.bendValue(), (int)0 );
	QCOMPARE( bend.bendValueToString(), QString("unknow bend value") );
	
	bend.setBendValue(25);
	QCOMPARE( bend.bendValue(), (int)25 );
	QCOMPARE( bend.bendValueToString(), QString("1/4") );
}

void TabBendTest::testBendPoint()
{
	TabBend bend;
	QList<TabBendPoint> list;
	QCOMPARE( bend.bendPoint(), QList<TabBendPoint>() );
	
	list.push_front(TabBendPoint());
	list.push_front(TabBendPoint());
	list.push_front(TabBendPoint());
	bend.setBendPoint(list);
	QCOMPARE( bend.bendPoint(), list );
}

void TabBendTest::testOperators()
{
	TabBend bend1;
	TabBend bend2;
	QCOMPARE( bend1 == bend2, true );
	QCOMPARE( bend1 != bend2, false );
	
	bend1.setBendType(TabBend::Bend);
	bend2.setBendValue(25);
	QCOMPARE( bend1 == bend2, false );
	QCOMPARE( bend1 != bend2, true );
}

QTEST_MAIN(TabBendTest)
#include "tabbendtest.moc"
