/*[Test]
title Example
create mpxharvestertest foobar
foobar Example pa ra me ters
delete foobar
[Endtest] 
*/

[Test]
title Create Harvester Utility
create mpxharvestertest utility
utility CreateUtility
delete utility 
pause 1000
[Endtest]

[Test]
title Scan for new files
create mpxharvestertest utility
utility CreateUtility
utility Scan
pause 20000
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Cancel scan
create mpxharvestertest utility
utility CreateUtility
utility Scan
pause 1000
utility CancelScan
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Add file
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility DeleteTestFile mpxtest1.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Remove file
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility RemoveFile mpxtest1.mp3
utility DeleteTestFile mpxtest1.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Remove files
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3 mpxtest2.mp3
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility AddFileByPath mpxtest2.mp3
waittestclass utility
utility RemoveFiles mpxtest1.mp3 mpxtest2.mp3
utility DeleteTestFile mpxtest1.mp3 mpxtest2.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Remove all files
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3 mpxtest2.mp3
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility AddFileByPath mpxtest2.mp3
waittestclass utility
utility RemoveFiles all
utility DeleteTestFile mpxtest1.mp3 mpxtest2.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Recreate databases
create mpxharvestertest utility
utility CreateUtility
utility RecreateDatabases
pause 5000
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Delete file
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
pause 2000
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility DeleteFile mpxtest1.mp3
waittestclass utility
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Delete files asynchronously
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3 mpxtest2.mp3
pause 2000
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility AddFileByPath mpxtest2.mp3
waittestclass utility
utility DeleteFiles async mpxtest1.mp3 mpxtest2.mp3
waittestclass utility
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Delete files synchronously
create mpxharvestertest utility
pause 2000
utility CopyTestFile mpxtest1.mp3 mpxtest2.mp3
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility AddFileByPath mpxtest2.mp3
waittestclass utility
utility DeleteFiles sync mpxtest1.mp3 mpxtest2.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Find collection id
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility FindCollectionId mpxtest1.mp3
utility RemoveFile mpxtest1.mp3
utility DeleteTestFile mpxtest1.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Rename file
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
utility CreateUtility
utility AddFileByPath mpxtest1.mp3
waittestclass utility
utility RenameFileByPath mpxtest1.mp3 mpxtest3.mp3
pause 2000
utility RemoveFile mpxtest3.mp3
utility DeleteTestFile mpxtest1.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title It is a playlist
create mpxharvestertest utility
utility CopyTestFile mpxtestplaylist.m3u
utility CreateUtility
utility IsPlaylist mpxtestplaylist.m3u true
pause 2000
utility DeleteTestFile mpxtestplaylist.m3u
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title It is not a playlist
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
utility CreateUtility
utility IsPlaylist mpxtest1.mp3 false
pause 2000
utility DeleteTestFile mpxtest1.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Import playlist successfully
create mpxharvestertest utility
utility CopyTestFile mpxtestplaylist.m3u
utility CreateUtility
utility ImportPlaylist mpxtestplaylist.m3u true
waittestclass utility
utility DeleteTestFile mpxtestplaylist.m3u
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Import playlist (mp3)
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
utility CreateUtility
utility ImportPlaylist mpxtest1.mp3 false
waittestclass utility
utility DeleteTestFile mpxtest1.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Import playlist (doesn't exist)
create mpxharvestertest utility
utility CreateUtility
utility ImportPlaylist mpxtestplaylist.m3u false
waittestclass utility
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Import file (playlist) successfully
create mpxharvestertest utility
utility CopyTestFile mpxtestplaylist.m3u
utility CreateUtility
utility ImportFile mpxtestplaylist.m3u true
waittestclass utility
utility DeleteTestFile mpxtestplaylist.m3u
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Import file (mp3) successfully
create mpxharvestertest utility
utility CopyTestFile mpxtest1.mp3
utility CreateUtility
utility ImportFile mpxtest1.mp3 true
waittestclass utility
utility DeleteTestFile mpxtest1.mp3
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Import file (doesn't exist)
create mpxharvestertest utility
utility CreateUtility
utility ImportFile mpxtest1.mp3 false
waittestclass utility
utility VerifyEvents
delete utility 
pause 1000
[Endtest]

[Test]
title Required attributes M3U
create mpxharvestertest utility
utility CreateUtility
utility RequiredAttributes M3U
delete utility 
pause 1000
[Endtest]

[Test]
title Optional attributes M3U
create mpxharvestertest utility
utility CreateUtility
utility OptionalAttributes M3U
delete utility 
pause 1000
[Endtest]

[Test]
title PlaylistFileExtension M3U
create mpxharvestertest utility
utility CreateUtility
utility PlaylistFileExtension M3U
delete utility 
pause 1000
[Endtest]

/*
// PLA is not supported yet
[Test]
title PlaylistFileExtension PLA
create mpxharvestertest utility
utility CreateUtility
utility PlaylistFileExtension PLA
delete utility 
pause 1000
[Endtest]
*/

[Test]
title CheckForSystemEvents
create mpxharvestertest utility
utility CreateUtility
utility CheckForSystemEvents
delete utility 
pause 1000
[Endtest]

