RegressionTests__ElectronGraphicDeviceTest.st
changeset 2383 02195169cac6
child 2487 da16a889dc0a
equal deleted inserted replaced
2382:5a220dc267d7 2383:02195169cac6
       
     1 "{ Package: 'stx:goodies/regression' }"
       
     2 
       
     3 "{ NameSpace: RegressionTests }"
       
     4 
       
     5 TestCase subclass:#ElectronGraphicDeviceTest
       
     6 	instanceVariableNames:'display'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'tests-Regression-Graphics-Basic'
       
    10 !
       
    11 
       
    12 !ElectronGraphicDeviceTest class methodsFor:'documentation'!
       
    13 
       
    14 documentation
       
    15 "
       
    16     documentation to be added.
       
    17 
       
    18     class:
       
    19         <a short class summary here, describing what instances represent>
       
    20 
       
    21     responsibilities:    
       
    22         <describing what my main role is>
       
    23 
       
    24     collaborators:    
       
    25         <describing with whom and how I talk to>
       
    26 
       
    27     API:
       
    28         <public api and main messages>
       
    29         
       
    30     example:
       
    31         <a one-line examples on how to use - can also be in a separate example method>
       
    32 
       
    33     implementation:
       
    34         <implementation points>
       
    35 
       
    36     [author:]
       
    37         exept MBP
       
    38 
       
    39     [instance variables:]
       
    40 
       
    41     [class variables:]
       
    42 
       
    43     [see also:]
       
    44 
       
    45 "
       
    46 ! !
       
    47 
       
    48 !ElectronGraphicDeviceTest methodsFor:'tests'!
       
    49 
       
    50 setUp
       
    51     display := ElectronWorkstation newFor:'localhost:8588'.
       
    52 !
       
    53 
       
    54 tearDown
       
    55     display notNil ifTrue:[
       
    56         display close
       
    57     ].
       
    58 
       
    59 !
       
    60 
       
    61 test_01_ConnectDisconnect
       
    62     self assert:(display notNil).
       
    63     self assert:(display isOpen).
       
    64     display close.
       
    65     self assert:(display isOpen not).
       
    66 
       
    67     "
       
    68      self new test_01_ConnectDisconnect
       
    69     "
       
    70 !
       
    71 
       
    72 test_02_Properties
       
    73     self assert:(display visualType notNil).
       
    74     display visualType == #TrueColor ifTrue:[
       
    75         self assert:(display hasColors).
       
    76         self assert:(display hasGreyscales).
       
    77     ].
       
    78 
       
    79     self assert:(display depth notNil).
       
    80     self assert:(display shiftRed notNil).
       
    81     self assert:(display shiftGreen notNil).
       
    82     self assert:(display shiftBlue notNil).
       
    83 
       
    84     self assert:(display blackpixel == 0).
       
    85     self assert:(display whitepixel == 16rFFFFFF).
       
    86 
       
    87     "
       
    88      self new test_02_Properties
       
    89     "
       
    90 !
       
    91 
       
    92 test_03_WindowCreation
       
    93     |v|
       
    94 
       
    95     v := TopView onDevice:display.
       
    96     
       
    97     "
       
    98      self new test_03_WindowCreation
       
    99     "
       
   100 !
       
   101 
       
   102 test_04_WindowCreateAndMap
       
   103     |v|
       
   104 
       
   105     v := TopView onDevice:display.
       
   106     v realize.
       
   107     v destroy.
       
   108 
       
   109     "
       
   110      self new test_04_WindowCreateAndMap
       
   111     "
       
   112 ! !
       
   113 
       
   114 !ElectronGraphicDeviceTest class methodsFor:'documentation'!
       
   115 
       
   116 version_CVS
       
   117     ^ '$Header$'
       
   118 ! !
       
   119