Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: service/user/testing.go

Issue 1522783002: Add User Testing interface to impl/memory. (Closed) Base URL: https://github.com/luci/gae.git@logging_service
Patch Set: add logout Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« impl/memory/user.go ('K') | « service/user/interface.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/user/testing.go
diff --git a/service/user/testing.go b/service/user/testing.go
new file mode 100644
index 0000000000000000000000000000000000000000..b85baf84b0b3391a416f53b2f65b9b98b0fde2a4
--- /dev/null
+++ b/service/user/testing.go
@@ -0,0 +1,18 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package user
+
+// Testing is the interface that test implimentations will provide.
+type Testing interface {
+ // SetUser sets the user to a pre-populated User object.
+ SetUser(*User)
+
+ // Login will generate and set a new User object with values derived from
+ // email and admin values.
+ Login(email string, admin bool)
+
+ // Equivalent to SetUser(nil), but a bit more obvious to read in the code :).
+ Logout()
+}
« impl/memory/user.go ('K') | « service/user/interface.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698