Skip to content

Commit c5fc2d9

Browse files
committed
example_data: Start generating account id
Signed-off-by: Zixuan James Li <[email protected]>
1 parent d27b46c commit c5fc2d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/example_data.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ User user({
142142
);
143143
}
144144

145+
/// A fresh user ID, from a random but always strictly increasing sequence.
146+
int _nextAccountId() => (_lastAccountId += 1 + Random().nextInt(100));
147+
int _lastAccountId = 1000;
148+
145149
Account account({
146150
int? id,
147151
Uri? realmUrl,
@@ -158,7 +162,7 @@ Account account({
158162
// generated to serve as a "Zulip API email".
159163
final email = user.deliveryEmail ?? _nextEmail();
160164
return Account(
161-
id: id ?? 1000, // TODO generate example IDs
165+
id: id ?? _nextAccountId(),
162166
realmUrl: realmUrl ?? _realmUrl,
163167
email: email,
164168
apiKey: apiKey ?? 'aeouasdf',

0 commit comments

Comments
 (0)