@@ -39,8 +39,8 @@ func TestConnect(t *testing.T) {
3939 t .Errorf (err .Error ())
4040 }
4141
42- if ! pop .IsAuthorized {
43- t .Errorf ("Expected: %v, got: %v" , true , pop .IsAuthorized )
42+ if ! pop .IsAuthorized () {
43+ t .Errorf ("Expected: %v, got: %v" , true , pop .isAuthorized )
4444 }
4545
4646 if pop .Addr != addr {
@@ -60,8 +60,8 @@ func TestConnectTLS(t *testing.T) {
6060 t .Errorf (err .Error ())
6161 }
6262
63- if ! pop .IsAuthorized {
64- t .Errorf ("Expected: %v, got: %v" , true , pop .IsAuthorized )
63+ if ! pop .IsAuthorized () {
64+ t .Errorf ("Expected: %v, got: %v" , true , pop .IsAuthorized () )
6565 }
6666
6767 if pop .Addr != addr {
@@ -86,8 +86,8 @@ func TestClient_Quit(t *testing.T) {
8686 t .Errorf (err .Error ())
8787 }
8888
89- if pop .IsAuthorized != false {
90- t .Errorf ("Expected c.IsAuthorized %v, got: %v" , false , pop .IsAuthorized )
89+ if pop .IsAuthorized () != false {
90+ t .Errorf ("Expected c.IsAuthorized %v, got: %v" , false , pop .IsAuthorized () )
9191 }
9292
9393 if ! strings .Contains (got , ok ) {
@@ -108,11 +108,55 @@ func TestClientTLS_Quit(t *testing.T) {
108108 t .Errorf (err .Error ())
109109 }
110110
111- if popTLS .IsAuthorized != false {
112- t .Errorf ("expected popTLS.IsAuthorized: %v, got: %v" , false , popTLS .IsAuthorized )
111+ if popTLS .IsAuthorized () != false {
112+ t .Errorf ("expected popTLS.IsAuthorized: %v, got: %v" , false , popTLS .IsAuthorized () )
113113 }
114114
115115 if ! strings .Contains (got , ok ) {
116116 t .Errorf ("expected: %s, got: %s" , ok , got )
117117 }
118118}
119+
120+ func TestClient_IsEncrypted (t * testing.T ) {
121+ pop , err := Connect ("pop.gmail.com:995" , nil , true )
122+ if err != nil {
123+ t .Errorf (err .Error ())
124+ }
125+
126+ if ! pop .IsEncrypted () {
127+ t .Errorf ("expected: %v, got: %v" , true , pop .IsEncrypted ())
128+ }
129+ }
130+
131+ func TestClient_IsNotEncrypted (t * testing.T ) {
132+ pop , err := Connect ("mail.pop3.com:110" , nil , false )
133+ if err != nil {
134+ t .Errorf (err .Error ())
135+ }
136+
137+ if pop .IsEncrypted () {
138+ t .Errorf ("expected: %v, got: %v" , false , pop .IsEncrypted ())
139+ }
140+ }
141+
142+ func TestClient_IsAuthorized (t * testing.T ) {
143+ pop , err := Connect ("mail.pop3.com:110" , nil , false )
144+ if err != nil {
145+ t .Errorf (err .Error ())
146+ }
147+
148+ if ! pop .IsAuthorized () {
149+ t .Errorf ("expected: %v, got: %v" , true , pop .IsAuthorized ())
150+ }
151+ }
152+
153+ func TestClient_GreetingMsg (t * testing.T ) {
154+ pop , err := Connect ("mail.pop3.com:110" , nil , false )
155+ if err != nil {
156+ t .Errorf (err .Error ())
157+ }
158+
159+ if ! strings .HasPrefix (pop .GreetingMsg (), ok ) {
160+ t .Errorf ("expected: %s, got: %s" , ok , pop .GreetingMsg ())
161+ }
162+ }
0 commit comments