initial checkin
authorClaus Gittinger <cg@exept.de>
Fri, 01 Jul 2011 16:23:24 +0200
changeset 10026 a2ae79b015b1
parent 10025 cdf041762f27
child 10027 06a629bbb47a
initial checkin
Tools__NavigationHistoryTests.st
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools__NavigationHistoryTests.st	Fri Jul 01 16:23:24 2011 +0200
@@ -0,0 +1,133 @@
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+"{ Package: 'stx:libtool' }"
+
+"{ NameSpace: Tools }"
+
+TestCase subclass:#NavigationHistoryTests
+	instanceVariableNames:'history'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Interface-History'
+!
+
+!NavigationHistoryTests class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2006 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+! !
+
+!NavigationHistoryTests methodsFor:'initialization'!
+
+setUp
+
+    history := NavigationHistory new
+
+    "Created: / 21-02-2008 / 16:52:19 / janfrog"
+! !
+
+!NavigationHistoryTests methodsFor:'tests'!
+
+test_01
+
+    self
+        assert: history canGoBack not;
+        assert: history canGoForward not
+
+    "Created: / 21-02-2008 / 16:54:55 / janfrog"
+!
+
+test_02
+
+    history goTo: 1.
+        
+    self
+        assert: history canGoBack not;
+        assert: history canGoForward not
+
+    "Created: / 21-02-2008 / 16:55:34 / janfrog"
+!
+
+test_03
+    history
+        goTo:1;
+        goTo:2;
+        goTo:3;
+        goBack.
+    self
+        assert:history currentItem = 2;
+        assert:history canGoBack;
+        assert:history goBackItems asArray = #( 1 );
+        assert:history canGoForward;
+        assert:history goForwardItems asArray = #( 3 ).
+
+    "Created: / 21-02-2008 / 16:57:29 / janfrog"
+    "Modified: / 27-02-2008 / 11:52:26 / janfrog"
+    "Modified: / 06-06-2008 / 09:31:24 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+test_04
+    history
+        goTo:1;
+        goTo:2;
+        goTo:3;
+        goTo:2.
+    self
+        assert:history currentItem = 2;
+        assert:history canGoBack;
+        assert:history goBackItems asArray = #( 1 );
+        assert:history canGoForward;
+        assert:history goForwardItems asArray = #( 3 ).
+
+    "Created: / 21-02-2008 / 16:57:58 / janfrog"
+    "Modified: / 27-02-2008 / 11:52:26 / janfrog"
+    "Modified: / 06-06-2008 / 09:31:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+test_05
+    history
+        goTo:1;
+        goTo:2;
+        goTo:3;
+        goBack;
+        goBack;
+        goTo:5.
+    self
+        assert:history currentItem = 5;
+        assert:history canGoBack;
+        assert:history goBackItems asArray = #( 1 );
+        assert:history canGoForward not.
+
+    "Created: / 21-02-2008 / 16:59:11 / janfrog"
+    "Modified: / 27-02-2008 / 11:52:12 / janfrog"
+    "Modified: / 06-06-2008 / 09:31:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
+!NavigationHistoryTests class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libtool/Tools__NavigationHistoryTests.st,v 1.1 2011-07-01 14:23:24 cg Exp $'
+!
+
+version_SVN
+    ^ '§Id: Tools__NavigationHistoryTests.st 7486 2009-10-26 22:06:24Z vranyj1 §'
+! !