/
STONTestUser.class.st
93 lines (77 loc) · 1.82 KB
/
STONTestUser.class.st
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
"
STONTestUser is used to support unit tests.
Instance Variables
enabled: <Boolean>
password: <String>
username: <String>
"
Class {
#name : #STONTestUser,
#superclass : #Object,
#instVars : [
'username',
'password',
'enabled'
],
#category : #'STON-Tests-Support'
}
{ #category : #'instance creation' }
STONTestUser class >> dummy [
"self dummy"
| username password |
username := String streamContents: [ :stream |
stream << 'user'; print: 999 atRandom; << '@company'; print: 99 atRandom; << '.com' ].
password := String streamContents: [ :stream |
stream << 'secret'; print: 999 atRandom ].
^ self new
username: username;
password: password;
yourself
]
{ #category : #'ston-core' }
STONTestUser class >> stonName [
^ #TestUser
]
{ #category : #comparing }
STONTestUser >> = anObject [
"Answer whether the receiver and anObject represent the same object."
self == anObject
ifTrue: [ ^ true ].
self class = anObject class
ifFalse: [ ^ false ].
^ username = anObject username and: [ password = anObject password and: [ enabled = anObject enabled ] ]
]
{ #category : #accessing }
STONTestUser >> enabled [
^ enabled
]
{ #category : #accessing }
STONTestUser >> enabled: anObject [
enabled := anObject
]
{ #category : #comparing }
STONTestUser >> hash [
"Answer an integer value that is related to the identity of the receiver."
^ username hash bitXor: (password hash bitXor: enabled hash)
]
{ #category : #'initialize-release' }
STONTestUser >> initialize [
super initialize.
enabled := true
]
{ #category : #accessing }
STONTestUser >> password [
^ password
]
{ #category : #accessing }
STONTestUser >> password: anObject [
password := anObject
]
{ #category : #accessing }
STONTestUser >> username [
^ username
]
{ #category : #accessing }
STONTestUser >> username: anObject [
username := anObject
]