mirror of
https://github.com/CPunch/gopenfusion.git
synced 2024-11-14 20:10:06 +00:00
login_tests: annotate tests
This commit is contained in:
parent
8e84f0c7b2
commit
77751a2aa0
@ -115,6 +115,7 @@ func TestMain(m *testing.M) {
|
|||||||
os.Exit(ret)
|
os.Exit(ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This test tries a typical login sequence.
|
||||||
func TestLoginSuccSequence(t *testing.T) {
|
func TestLoginSuccSequence(t *testing.T) {
|
||||||
is := is.New(t)
|
is := is.New(t)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
@ -148,6 +149,7 @@ func TestLoginSuccSequence(t *testing.T) {
|
|||||||
is.NoErr(err) // TryLogin() should not return an error
|
is.NoErr(err) // TryLogin() should not return an error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This test tries a typical login sequence, but with an invalid password.
|
||||||
func TestLoginFailSequence(t *testing.T) {
|
func TestLoginFailSequence(t *testing.T) {
|
||||||
is := is.New(t)
|
is := is.New(t)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
@ -177,6 +179,7 @@ func TestLoginFailSequence(t *testing.T) {
|
|||||||
is.Equal(resp.IErrorCode, int32(login.LOGIN_ID_AND_PASSWORD_DO_NOT_MATCH)) // should respond with LOGIN_ID_AND_PASSWORD_DO_NOT_MATCH
|
is.Equal(resp.IErrorCode, int32(login.LOGIN_ID_AND_PASSWORD_DO_NOT_MATCH)) // should respond with LOGIN_ID_AND_PASSWORD_DO_NOT_MATCH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This test tries a typical login sequence, and creates a character
|
||||||
func TestCharacterSequence(t *testing.T) {
|
func TestCharacterSequence(t *testing.T) {
|
||||||
is := is.New(t)
|
is := is.New(t)
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
|
Loading…
Reference in New Issue
Block a user