mirror of
https://github.com/wahyd4/loginsrv.git
synced 2026-08-09 04:46:29 +10:00
32 lines
616 B
Go
32 lines
616 B
Go
package oauth2
|
|
|
|
import (
|
|
. "github.com/stretchr/testify/assert"
|
|
"testing"
|
|
)
|
|
|
|
func Test_ProviderRegistration(t *testing.T) {
|
|
github, exist := GetProvider("github")
|
|
NotNil(t, github)
|
|
True(t, exist)
|
|
|
|
google, exist := GetProvider("google")
|
|
NotNil(t, google)
|
|
True(t, exist)
|
|
|
|
bitbucket, exist := GetProvider("bitbucket")
|
|
NotNil(t, bitbucket)
|
|
True(t, exist)
|
|
|
|
facebook, exist := GetProvider("facebook")
|
|
NotNil(t, facebook)
|
|
True(t, exist)
|
|
|
|
list := ProviderList()
|
|
Equal(t, 4, len(list))
|
|
Contains(t, list, "github")
|
|
Contains(t, list, "google")
|
|
Contains(t, list, "bitbucket")
|
|
Contains(t, list, "facebook")
|
|
}
|