/***************************************************************************
 * tabgracenotetest.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 "tabgracenotetest.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 TabGraceNoteTest::testDuration()
{
	TabGraceNote grace;
	QCOMPARE( grace.graceNoteDuration(), (int)0 );
	
	grace.setGraceNoteDuration(500);
	QCOMPARE( grace.graceNoteDuration(), (int)500 );
}

void TabGraceNoteTest::testDynamic()
{
	TabGraceNote grace;
	QCOMPARE( grace.graceNoteDynamic(), NoneDynamic );
	
	grace.setGraceNoteDynamic(MezzoPiano);
	QCOMPARE( grace.graceNoteDynamic(), MezzoPiano );
}

void TabGraceNoteTest::testFret()
{
	TabGraceNote grace;
	QCOMPARE( grace.graceNoteFret(), (int)0 );
	
	grace.setGraceNoteFret(5);
	QCOMPARE( grace.graceNoteFret(), (int)5 );
}

void TabGraceNoteTest::testTransition()
{
	TabGraceNote grace;
	QCOMPARE( grace.graceNoteTransition(), NoneTransition );
	
	grace.setGraceNoteTransition(HammerTransition);
	QCOMPARE( grace.graceNoteTransition(), HammerTransition );
}

void TabGraceNoteTest::testOperators()
{
	TabGraceNote grace1;
	TabGraceNote grace2;
	QCOMPARE( grace1 == grace2, true );
	QCOMPARE( grace1 != grace2, false );
	
	grace1.setGraceNoteFret(5);
	grace2.setGraceNoteTransition(HammerTransition);
	QCOMPARE( grace1 == grace2, false );
	QCOMPARE( grace1 != grace2, true );
}

QTEST_MAIN(TabGraceNoteTest)
#include "tabgracenotetest.moc"
