summaryrefslogtreecommitdiff
path: root/pharo-mooc/contact-book/src/ContactBook/ContactBookTest.class.st
blob: 6e5cf2dd8eee8e51da6a6da54a42319bbfdf09de (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
31
32
33
34
35
36
37
38
39
40
41
Class {
	#name : 'ContactBookTest',
	#superclass : 'TestCase',
	#instVars : [
		'blog',
		'post'
	],
	#category : 'ContactBook',
	#package : 'ContactBook'
}

{ #category : 'running' }
ContactBookTest >> setUp [
	blog := ContactBook new.
	blog addContact: (Contact newNamed: 'Tudor Girba' email: 'tudor@tudorgirba.com').
	
	post := Contact newNamed: 'Clara Allende' email: 'clari.allende@gmail.com'
]

{ #category : 'tests' }
ContactBookTest >> testAddContact [
	blog addContact: post.
	self assert: blog size equals: 2
]

{ #category : 'tests' }
ContactBookTest >> testContacts [
	blog addContact: post.
	self assert: blog contacts size equals: 2
]

{ #category : 'tests' }
ContactBookTest >> testRemoveContact [
	blog removeContact: blog contacts first.
	self assert: blog size equals: 0
]

{ #category : 'tests' }
ContactBookTest >> testSize [
	self assert: blog size equals: 1
]