2024-01-30 17:08:29 +00:00
|
|
|
Class {
|
2024-05-26 22:37:09 +00:00
|
|
|
#name : 'InstagramUrlTest',
|
|
|
|
#superclass : 'TestCase',
|
|
|
|
#category : 'Instagram-Tests',
|
|
|
|
#package : 'Instagram-Tests'
|
2024-01-30 17:08:29 +00:00
|
|
|
}
|
|
|
|
|
2024-05-26 22:43:22 +00:00
|
|
|
{ #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'.
|
|
|
|
]
|
|
|
|
|
2024-05-26 22:37:09 +00:00
|
|
|
{ #category : 'tests' }
|
2024-01-30 17:08:29 +00:00
|
|
|
InstagramUrlTest >> testInstagramUrlInstanceCreation [
|
|
|
|
| i |
|
|
|
|
i := InstagramUrl newURL: 'instagram.com'.
|
|
|
|
self assert: i url asStringOrText equals: 'https://instagram.com/'
|
|
|
|
]
|
|
|
|
|
2024-05-26 22:37:09 +00:00
|
|
|
{ #category : 'tests' }
|
2024-01-30 17:08:29 +00:00
|
|
|
InstagramUrlTest >> testNotInstagramUrl1 [
|
|
|
|
| i |
|
|
|
|
i := InstagramUrl newURL: 'nstgrm.com'.
|
2024-05-26 22:43:22 +00:00
|
|
|
self assert: i url asStringOrText equals: 'https://instagram.com/'
|
2024-01-30 17:08:29 +00:00
|
|
|
]
|
|
|
|
|
2024-05-26 22:37:09 +00:00
|
|
|
{ #category : 'tests' }
|
2024-01-30 17:08:29 +00:00
|
|
|
InstagramUrlTest >> testNotInstagramUrl2 [
|
|
|
|
| i |
|
|
|
|
i := InstagramUrl newURL: 'nstgrm.com'.
|
|
|
|
self assert: i class equals: InstagramUrl new class.
|
|
|
|
]
|
2024-05-26 22:43:22 +00:00
|
|
|
|
|
|
|
{ #category : 'tests' }
|
|
|
|
InstagramUrlTest >> testUndefindeType [
|
|
|
|
| i |
|
|
|
|
i := InstagramUrl newURL: 'instagram.com/ruidajo_/a'.
|
|
|
|
self assert: i type equals: 'UndefinedType'.
|
|
|
|
]
|