Skip to content

Commit

Permalink
added test and refactored according to project conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingmar Vogel committed May 20, 2024
1 parent 1545317 commit e377a8d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
testing
testRemoveQuestion

| question1 question2|
self assert: self pollDraft questionList isEmpty.

question1 := LQChoicesQuestion new.
question1 title: 'An interesting first question!'.
self pollDraft addQuestion: question1.
question2 := LQChoicesQuestion new.
question2 title: 'An interesting second question!'.
self pollDraft addQuestion: question2.

self pollDraft removeQuestionAt: 1.
self assert: self pollDraft questionList size equals: 1.
self assert: self pollDraft questionList first title equals: 'An interesting second question!'
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"pollDraft" : "NM 7/9/2021 16:21",
"pollDraft:" : "NM 7/9/2021 16:21",
"setUp" : "CG 7/30/2021 19:06",
"testAddQuestion" : "kge 8/4/2022 19:04",
"testAddQuestion" : "Ingmar Vogel 5/20/2024 11:07",
"testPollDraftTitleCanBeSet" : "CG 7/30/2021 19:06",
"testRemoveQuestion" : "Ingmar Vogel 5/20/2024 11:10",
"testWhitespaceRemoving" : "JT 8/5/2022 18:53" } }
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
modifying
removeQuestion

self questionBuilders size > 1
ifTrue:[
self pollDraft removeQuestionAt: self getIndex.
self removeQuestionBuilderAt: self getIndex.
self setIndex: self questionBuilders size.
self changed: #list]
self questionBuilders size > 1 ifTrue: [self pollDraft removeQuestionAt: self getIndex.
self removeQuestionBuilderAt: self getIndex.
self setIndex: self questionBuilders size.
self changed: #list]
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"questionBuilders" : "bn 8/2/2022 16:59",
"questionBuilders:" : "bn 6/23/2022 21:55",
"questionListFrame" : "bn 8/2/2022 16:59",
"removeQuestion" : "Ingmar Vogel 5/19/2024 15:55",
"removeQuestion" : "Ingmar Vogel 5/20/2024 11:01",
"removeQuestionBuilderAt:" : "Ingmar Vogel 5/19/2024 15:42",
"removeQuestionButtonFrame" : "Ingmar Vogel 5/19/2024 15:31",
"runPoll" : "JT 8/5/2022 18:52",
Expand Down

0 comments on commit e377a8d

Please sign in to comment.