diff options
Diffstat (limited to 'pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st')
| -rw-r--r-- | pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st b/pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st new file mode 100644 index 0000000..d9a2f78 --- /dev/null +++ b/pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st @@ -0,0 +1,30 @@ +Class { + #name : 'TBPostTest', + #superclass : 'TestCase', + #category : 'TinyBlog-Tests', + #package : 'TinyBlog-Tests' +} + +{ #category : 'tests' } +TBPostTest >> testPostIsCreatedCorrectly [ + + | post | + post := TBPost + title: 'Welcome to TinyBlog' + text: 'TinyBlog is a small blog engine made with Pharo.' + category: 'TinyBlog'. + self assert: post title equals: 'Welcome to TinyBlog'. + self assert: post text equals: 'TinyBlog is a small blog engine made with Pharo.'. +] + +{ #category : 'tests' } +TBPostTest >> testWithoutCategoryIsUnclassified [ + + | post | + post := TBPost + title: 'Welcome to TinyBlog' + text: 'TinyBlog is a small blog engine made with Pharo.'. + self assert: post title equals: 'Welcome to TinyBlog'. + self assert: post isUnclassified. + self deny: post isVisible +] |
