# RBC.barchart.axis.cget.A.test --
#
###Abstract
# This file tests the axis cget function of the barchart BLT component.
# Axis cget is an instance function of barchart.
#
###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 barchart.axis

package require rbc
namespace import rbc::*

package require tcltest
namespace import tcltest::*
namespace eval barchart.axis {
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the axis cget command works correctly when given a valid 
	# axis configuration option name and a single axis
	# ------------------------------------------------------------------------------------
	test RBC.barchart.axis.cget.A.1.1 {
		Valid Option Name, One Axis
	} -setup {
		barchart .barchart1
		.barchart1 axis create Axis1
		.barchart1 axis configure Axis1 -color black
	} -body {
		.barchart1 axis cget Axis1 -color
	} -cleanup {
		destroy .barchart1
	} -result {black}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the axis cget command works correctly when given an invalid 
	# axis configuration option name and a single axis
	# ------------------------------------------------------------------------------------
	test RBC.barchart.axis.cget.A.1.2 {
		Invalid Option Name, One Axis
	} -setup {
		barchart .barchart1
		.barchart1 axis create Axis1
	} -body {
		if {[catch {.barchart1 axis cget Axis1 -invalid}]} {
			return 0
		} else {
			return 1
		}
	} -cleanup {
		destroy .barchart1
	} -result {0}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the axis cget command works correctly when given a valid 
	# axis configuration option name and two axis.
	# ------------------------------------------------------------------------------------
	test RBC.barchart.axis.cget.A.1.3 {
		Valid Option Name, Two Axis
	} -setup {
		barchart .barchart1
		.barchart1 axis create Axis1
		.barchart1 axis create Axis2
		.barchart1 axis configure Axis1 Axis2 -color black
	} -body {
		list [.barchart1 axis cget Axis1 -color] [.barchart1 axis cget Axis2 -color]
	} -cleanup {
		destroy .barchart1
	} -result {black black}
	
	# Purpose: Should we test the axis cget command when given an invalid name and two axis
	
	
	cleanupTests
}