This repository has been archived on 2020-04-20. You can view files and clone it, but cannot push or open issues or pull requests.
libricochet-go/connection/authorizationmanager_test.go

19 lines
459 B
Go

package connection
import (
"testing"
)
func TestAuthorizationManager(t *testing.T) {
am := new(AuthorizationManager)
am.Init()
am.AddAuthorization("test")
if am.Authorized("test") != nil {
t.Errorf("Authorized(test) should return nil, instead returned error: %v", am.Authorized("test"))
}
if am.Authorized("not_authed") == nil {
t.Errorf("Authorized(not_authed) should return error, instead returned nil: %v", am.Authorized("not_authed"))
}
}