Adding tests for url types.
This commit is contained in:
parent
c8a8be21fa
commit
ac3f3757d8
@ -5,6 +5,41 @@ Class {
|
|||||||
#package : 'Instagram-Tests'
|
#package : 'Instagram-Tests'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ #category : 'tests' }
|
||||||
|
InstagramUrlTest >> testCorrectType [
|
||||||
|
| i |
|
||||||
|
i := InstagramUrl newURL: 'instagram.com/ruidajo_'.
|
||||||
|
self assert: i type equals: 'user'.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'tests' }
|
||||||
|
InstagramUrlTest >> testCorrectType2 [
|
||||||
|
| i |
|
||||||
|
i := InstagramUrl newURL: 'instagram.com/ruidajo_/'.
|
||||||
|
self assert: i type equals: 'user'.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'tests' }
|
||||||
|
InstagramUrlTest >> testCorrectType3 [
|
||||||
|
| i |
|
||||||
|
i := InstagramUrl newURL: 'instagram.com/'.
|
||||||
|
self assert: i type equals: 'root'.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'tests' }
|
||||||
|
InstagramUrlTest >> testCorrectType4 [
|
||||||
|
| i |
|
||||||
|
i := InstagramUrl newURL: 'instagram.com'.
|
||||||
|
self assert: i type equals: 'root'.
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : 'tests' }
|
||||||
|
InstagramUrlTest >> testIncorrectTypeSetByUrl [
|
||||||
|
| i |
|
||||||
|
i := InstagramUrl new type: 'as'.
|
||||||
|
self assert: i type equals: 'root'.
|
||||||
|
]
|
||||||
|
|
||||||
{ #category : 'tests' }
|
{ #category : 'tests' }
|
||||||
InstagramUrlTest >> testInstagramUrlInstanceCreation [
|
InstagramUrlTest >> testInstagramUrlInstanceCreation [
|
||||||
| i |
|
| i |
|
||||||
@ -16,7 +51,7 @@ InstagramUrlTest >> testInstagramUrlInstanceCreation [
|
|||||||
InstagramUrlTest >> testNotInstagramUrl1 [
|
InstagramUrlTest >> testNotInstagramUrl1 [
|
||||||
| i |
|
| i |
|
||||||
i := InstagramUrl newURL: 'nstgrm.com'.
|
i := InstagramUrl newURL: 'nstgrm.com'.
|
||||||
self assert: i url asStringOrText equals: 'https://www.instagram.com/'
|
self assert: i url asStringOrText equals: 'https://instagram.com/'
|
||||||
]
|
]
|
||||||
|
|
||||||
{ #category : 'tests' }
|
{ #category : 'tests' }
|
||||||
@ -25,3 +60,10 @@ InstagramUrlTest >> testNotInstagramUrl2 [
|
|||||||
i := InstagramUrl newURL: 'nstgrm.com'.
|
i := InstagramUrl newURL: 'nstgrm.com'.
|
||||||
self assert: i class equals: InstagramUrl new class.
|
self assert: i class equals: InstagramUrl new class.
|
||||||
]
|
]
|
||||||
|
|
||||||
|
{ #category : 'tests' }
|
||||||
|
InstagramUrlTest >> testUndefindeType [
|
||||||
|
| i |
|
||||||
|
i := InstagramUrl newURL: 'instagram.com/ruidajo_/a'.
|
||||||
|
self assert: i type equals: 'UndefinedType'.
|
||||||
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user