summaryrefslogtreecommitdiff
path: root/pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2025-11-21 22:20:10 +0100
committerEugen Wissner <belka@caraus.de>2025-11-21 22:20:10 +0100
commitc03c9f8b886c0e8eca5a701c0ca941e05e0b6285 (patch)
tree5f27293563caa042b182de97fe59b22e2cbd533a /pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st
parentc0336dac8effb57c04221f23b72bff70170933c5 (diff)
downloadbook-exercises-c03c9f8b886c0e8eca5a701c0ca941e05e0b6285.tar.gz
Add pharo tiny blog
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.st30
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
+]