(define widget ([] "UiWidget" alloc)) (define x 0.5) (define y 0.4) (define position '(0.5 0.125)) (define width 0.25) (define height 0.4) (define size '(0.25 0.125)) (define layer 3) (greg-testcase "UiWidget initialisation" #t (lambda () (equal? widget ([] widget initWithPosition: position size: size)))) (greg-testcase "UiWiget position after initialisation" #t (lambda () (equal? position ([] widget position)))) (greg-testcase "UiWiget size after initialisation" #t (lambda () (equal? size ([] widget size)))) (greg-testcase "test if setSize affects the member _size" #t (lambda () ([] widget setSize: '(0.375 0.125)) (equal? '(0.375 0.125) ([] widget size)))) ;(greg-testcase "test if setHeight affects the member _height" #t ; (lambda () ; ([] widget setHeight: 0.3) ; (equal? 0.3 ([] widget height)))) (greg-testcase "test if the isEnabled and setEnabled works correctly" #t (lambda () ([] widget setEnabled: #f) (not (gstep-bool ([] widget isEnabled))))) (greg-testcase "test if the hasFocus and setFocus works correctly" #t (lambda () ([] widget setFocus: #f) (not (gstep-bool ([] widget hasFocus))))) (greg-testcase "test if the setLayer and layer affects and return the good value" #t (lambda () ([] widget setLayer: layer) (equal? layer ([] widget layer)))) (greg-testcase "test if the show method changes the boolean _visible to YES" #t (lambda () ([] widget show) (gstep-bool ([] widget isVisible)))) (greg-testcase "test if the hide method changes the boolean _visible to NO" #t (lambda () ([] widget hide) (not (gstep-bool ([] widget isVisible)))))