/* Test Script for EmployeeSorter Application of InsertSorter Framework
   H. Conrad Cunningham
   Version #1:  28 March 2010

   This coder runs the EmployeeSorter application of similar to the
   InsertionSorter framework from the C++ example from section 21.1.1
   of Timothy Budd's _An Introduction to Object-Oriented Programming_,
   Third Edition.

123456789012345678901234567890123456789012345678901234567890123456789012345678

*/

// Employee records (use Scala case class for convenience)
case class Employee(name: String, salary: Int, startingYear: Int) 


object TestEmployeeSorter {

  // Do some testing
  def main(args: Array[String]) {

    val data = Array(Employee("Two",  10, 2007), 
                     Employee("One",   9, 2006), 
                     Employee("Three", 8, 2008), 
                     Employee("Zero", 12, 2005) )

    println("Unsorted data:  " + data.toList.mkString(", ") )    
    val sorter = new EmployeeSorter(data,data.length)
    sorter.sort
    println("Sorted data:    " + data.toList.mkString(", ") ) 
 }

}

