# RBC.stripchart.element.deactivate.A.test --
#
###Abstract
# This file contains the automatic tests that test the element deactivate 
# function of the stripchart 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 stripchart.element

package require rbc
namespace import rbc::*

package require tcltest
namespace import tcltest::*
namespace eval stripchart.element {
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the element deactivate command works correctly when given a valid
	# element name.
	# ------------------------------------------------------------------------------------
	test RBC.stripchart.element.deactivate.A.1.1 {
		stripchart element: deactivate - valid element name
	} -setup {
		stripchart .stripchart1
		.stripchart1 element create Element1
		.stripchart1 element activate Element1
	} -body {
		.stripchart1 element deactivate Element1
		.stripchart1 element activate
	} -cleanup {
		.stripchart1 element delete Element1
		destroy .stripchart1
	} -result {}
	
	# ------------------------------------------------------------------------------------
	# Purpose: Ensure the element deactivate command works correctly when given an invalid
	# element name.
	# ------------------------------------------------------------------------------------
	test RBC.stripchart.element.deactivate.A.1.2 {
		stripchart element: deactivate - invalid element name
	} -setup {
		stripchart .stripchart1
		.stripchart1 element create Element1
	} -body {
		if {[catch {.stripchart1 element deactivate invalid}]} {
			return 0
		} else {
			return 1
		}
	} -cleanup {
		.stripchart1 element delete Element1
		destroy .stripchart1
	} -result {0}
	
	cleanupTests
}
