summaryrefslogtreecommitdiff
path: root/pharo-mooc/tiny-blog/src/TinyBlog-Tests/TBPostTest.class.st
blob: d9a2f78c79e883a957c909bec4cb6d20cb5e85b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
]