From c03c9f8b886c0e8eca5a701c0ca941e05e0b6285 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Fri, 21 Nov 2025 22:20:10 +0100 Subject: Add pharo tiny blog --- .../src/TinyBlog-Tests/TBPostTest.class.st | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st (limited to 'pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st') 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 +] -- cgit v1.2.3