Starting test on the core funcitonality for the model... finally! ;-).

This commit is contained in:
Offray Vladimir Luna Cárdenas 2017-01-31 13:33:01 +00:00 committed by SantiagoBragagnolo
parent 8f2578d680
commit dd95e544e6
6 changed files with 62 additions and 4 deletions

View File

@ -82,9 +82,9 @@ GrafoscopioDocumentation class >> update [
]
{ #category : #'as yet unclassified' }
{ #category : #updating }
GrafoscopioDocumentation class >> updateDocsPlaceUI [
self current localPlace: (UIManager default chooseDirectory: 'Path to the documents Folder')
self current localPlace: (UIManager default chooseDirectory: 'Path to the documentation folder')
]
{ #category : #accessing }

View File

@ -443,7 +443,7 @@ GrafoscopioGUI class >> startDockingBar [
add: 'Grafoscopio' target: self selector: #updateGrafoscopioUI;
add: 'Documentation' target: self selector: #updateDocumentationUI;
add: 'DataViz package' target: self selector: #updateDatavizUI;
add: 'Documents place' target: GrafoscopioDocumentation selector: #updateDocsPlaceUI;
add: 'Notebooks places' target: GrafoscopioDocumentation selector: #updateDocsPlaceUI;
"add: 'Database engine' target: ExternalApp selector: #installSQLite32BitsUI;
add: 'Pandoc path' target: ExternalApp selector: #configurePandoc;
add: 'Fossil path' target: ExternalApp selector: #configureFossil;"
@ -451,8 +451,9 @@ GrafoscopioGUI class >> startDockingBar [
helpMenu := MenuMorph new.
helpMenu
add: 'Tutorial' target: (GrafoscopioNotebook new) selector: #openTutorial;
add: 'Tutorial (Spanish)' target: (GrafoscopioNotebook new) selector: #openTutorial;
add: 'Manual' target: (self new) selector: #openManual;
add: 'Manual (PDF)' target: (self new) selector: #openPDFManual;
add: 'About Grafoscopio' target: self selector: #messageAbout.
dockingBar := DockingBarMorph new.

View File

@ -134,6 +134,21 @@ GrafoscopioNode >> ancestors [
^ ancestors
]
{ #category : #accessing }
GrafoscopioNode >> ancestorsAll [
"I return a collection of all the nodes wich are ancestors of the receiver node"
| currentNode ancestors |
currentNode := self.
ancestors := OrderedCollection new.
[ currentNode parent notNil and: [ currentNode level > 0 ] ]
whileTrue: [
ancestors add: currentNode parent.
currentNode := currentNode parent].
ancestors := ancestors reversed.
^ ancestors
]
{ #category : #accessing }
GrafoscopioNode >> ancestorsHeaders [
"Returns the headers of all the ancestors of the node.
@ -657,6 +672,14 @@ GrafoscopioNode >> removeNode: aNode [
]
{ #category : #accessing }
GrafoscopioNode >> root [
"I return the node of the Grafoscopio tree that contains the receiver"
self level = 0
ifTrue: [ ^ self ]
ifFalse: [ ^ self ancestors first. ]
]
{ #category : #accessing }
GrafoscopioNode >> saveContent: anObject [
"Sets the receivers body to the given object"

View File

@ -0,0 +1,23 @@
"
I test the main functionality of the GrafoscopioNode class.
"
Class {
#name : #GrafoscopioNodeTest,
#superclass : #TestCase,
#category : #'Grafoscopio-Model'
}
{ #category : #tests }
GrafoscopioNodeTest >> testAddingChildren [
| tree nnode orig modif |
tree := GrafoscopioNode new becomeDefaultTestTree.
nnode := GrafoscopioNode new.
orig := tree children size.
tree addNode: nnode.
]
{ #category : #tests }
GrafoscopioNodeTest >> testInitializeIsOk [
self shouldnt: [ GrafoscopioNode new ] raise: Error
]

View File

@ -178,6 +178,7 @@ GrafoscopioNotebook >> initializeWidgets [
add: header;
add: body;
add: links.
self askOkToClose: true.
]
{ #category : #accessing }
@ -382,6 +383,11 @@ GrafoscopioNotebook >> notebookSubMenu [
action: [ self inform: 'To be implemented...' ] ] ]
]
{ #category : #private }
GrafoscopioNotebook >> okToChange [
^ true
]
{ #category : #persistence }
GrafoscopioNotebook >> openDefault [
"I open a new default notebook"

View File

@ -27,6 +27,11 @@ ManifestGrafoscopio class >> ruleRBSentNotImplementedRuleV1FalsePositive [
^ #(#(#(#RGMetaclassDefinition #(#'GrafoscopioGUI class' #GrafoscopioGUI)) #'2015-12-23T10:38:16.706667-05:00') #(#(#RGClassDefinition #(#GrafoscopioGUI)) #'2016-01-06T18:53:45.844051-05:00') #(#(#RGMethodDefinition #(#GrafoscopioNotebook #newWindowMainMenu #false)) #'2016-12-17T18:51:40.617924-05:00') )
]
{ #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBShouldntRaiseErrorRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#GrafoscopioNodeTest #testInitializeIsOk #false)) #'2017-01-31T12:49:28.199769-05:00') )
]
{ #category : #'code-critics' }
ManifestGrafoscopio class >> ruleRBStringConcatenationRuleV1FalsePositive [
^ #(#(#(#RGMethodDefinition #(#'FileUtils class' #createFilesNamed:endingWith:intoFolder: #true)) #'2017-01-01T21:48:26.712639-05:00') )