Skip to content

Instantly share code, notes, and snippets.

@iporsut
Created October 21, 2014 15:11
Show Gist options
  • Save iporsut/41bfe0a2c43e0a2ae884 to your computer and use it in GitHub Desktop.
Save iporsut/41bfe0a2c43e0a2ae884 to your computer and use it in GitHub Desktop.
System Test Go
type System struct {
Authorizer authorizer.Authorizer
}
func (system *System) LoginCount() int {
return 0
}
func TestNewlyCreatedSystemHasNoLoggedInUsers(t *testing.T) {
system := &System { &authorizer.DummyAuthorizer{} }
loginCount := system.LoginCount()
expectedLoginCount := 0
if loginCount != expectedLoginCount {
t.Errorf("Expect Login Count as %d but %d", expectedLoginCount, loginCount)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment