FileBrowserV2Tests.st
author penk
Wed, 09 Oct 2002 14:20:58 +0200
changeset 3964 8697bad1c903
parent 3953 4fd0ed70cf36
child 4025 f2f8fca68876
permissions -rw-r--r--
next stage for history

"{ Package: 'stx:libtool' }"

TestCase subclass:#FileBrowserV2Tests
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Tools-File'
!

!FileBrowserV2Tests class methodsFor:'documentation'!

documentation
"
    documentation to be added.

    [author:]
        Christian Penk (penk@bierfix)

    [instance variables:]

    [class variables:]

    [see also:]

"
!

history
    "Created: / 31.7.2002 / 11:59:23 / penk"
! !

!FileBrowserV2Tests methodsFor:'initialize / release'!

setUp
    "common setup - invoked before testing"

    super setUp
!

tearDown
    "common cleanup - invoked after testing"

    super tearDown
! !

!FileBrowserV2Tests methodsFor:'tests'!

testDirectoryHistory
    "Just a demonstration testCase.
     Double click on the TestCase class or open a TestRunner to see me checking...
     - please add more methods like this..."

    |history|

    history := AbstractFileBrowser directoryHistoryClass new.
    self shouldnt: (history canBackFrom:'1').
    history addToHistory:'1'.
    self should:(history canBackFrom:'2').
    self shouldnt:(history canForward).
    history addToHistory:'2'.
    history addToHistory:'3'.
    self should:(history canBackFrom:'4').
    self shouldnt: (history canForward).
    self should: ((history goBackFrom:'4') = '3').
    self should: ((history goBackFrom:'3') = '2').
    self should: (history canForward).
    self should: ((history goForward) = '3').
    self shouldnt: (history canForward).

    

    "
     self run:#testDirectoryHistory
    "
!

testFileItem
    "Just a demonstration testCase.
     Double click on the TestCase class or open a TestRunner to see me checking...
     - please add more methods like this..."

    | file item|

    file := Filename homeDirectory construct:'work/stx/doc/online/english/index.html'.
    file exists ifTrue:[
        item := DirectoryContentsBrowser itemClass with:file.
        self should:(item mimeType = 'text/html').
    ].

    "
     self run:#testFileItem
    "
!

testHardLink
    "Just a demonstration testCase.
     Double click on the TestCase class or open a TestRunner to see me checking...
     - please add more methods like this..."

    |browser|

    browser := FileBrowserV2 new.
    
    self should: ( browser isKindOf:AbstractFileBrowser ).
    self should: ( browser respondsTo:#newHardLink ).
    
"/    self should: [ o at:0 ] raise:Error.

    "
     self run:#testHardLink
    "
! !

!FileBrowserV2Tests class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libtool/FileBrowserV2Tests.st,v 1.3 2002-10-09 12:20:58 penk Exp $'
! !