# RBC.graph.legend.cget.A.test --
#
###Abstract
# This file contains the automatic tests that test the legend cget 
# function of the graph BLT component.
#
###Copyright
# See the file "license.terms" for information on usage and
# redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
###Revision String
# SVN: $Id$

###Package Definition
package provide graph.legend

package require rbc
namespace import rbc::*

package require tcltest
namespace import tcltest::*
namespace eval graph.legend {    
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure that cget works for default values.
	# ------------------------------------------------------------------------------------ 
	#  The intention is to check for a null string default value, but some
	#  systems have non-default values.  Not sure how to do this test, exactly.
	# ------------------------------------------------------------------------------------ 
	#test RBC.graph.legend.cget.A.1.1 {
	#    Test legend cget default
	#} -setup {
	#    graph .graph1
	#    pack .graph1
	#} -body {
	#    .graph1 legend cget -background
	#} -cleanup {
	#    destroy .graph1
	#} -result {}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure that cget works with an explicitly set option.
	# ------------------------------------------------------------------------------------ 
	test RBC.graph.legend.cget.A.1.2 {
	    Test legend cget configured
	} -setup {
	    graph .graph1
	    pack .graph1
	    .graph1 legend configure -background blue  
	} -body {
	    .graph1 legend cget -background
	} -cleanup {
	    destroy .graph1
	} -result {blue}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure that cget works with invalid input.
	# ------------------------------------------------------------------------------------ 
	test RBC.graph.legend.cget.A.1.3 {
	    Test legend cget configured
	} -setup {
	    graph .graph1
	    pack .graph1  
	} -body {
	    if {[catch {.graph1 legend cget -invalid}]} {
			return 0
	    } else {
			return 1
	    }
	} -cleanup {
	    destroy .graph1
	} -result {0}
	
	cleanupTests
}
