(t *testing.T)
| 143 | } |
| 144 | |
| 145 | func TestValidatePassword(t *testing.T) { |
| 146 | want := EncodePassword("123456", "rands") |
| 147 | tests := []struct { |
| 148 | name string |
| 149 | password string |
| 150 | rands string |
| 151 | wantEqual bool |
| 152 | }{ |
| 153 | { |
| 154 | name: "correct", |
| 155 | password: "123456", |
| 156 | rands: "rands", |
| 157 | wantEqual: true, |
| 158 | }, |
| 159 | |
| 160 | { |
| 161 | name: "wrong password", |
| 162 | password: "111333", |
| 163 | rands: "rands", |
| 164 | wantEqual: false, |
| 165 | }, |
| 166 | { |
| 167 | name: "wrong salt", |
| 168 | password: "111333", |
| 169 | rands: "salt", |
| 170 | wantEqual: false, |
| 171 | }, |
| 172 | } |
| 173 | for _, test := range tests { |
| 174 | t.Run(test.name, func(t *testing.T) { |
| 175 | got := ValidatePassword(want, test.rands, test.password) |
| 176 | assert.Equal(t, test.wantEqual, got) |
| 177 | }) |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | func TestMailResendCacheKey(t *testing.T) { |
| 182 | got := MailResendCacheKey(1) |
nothing calls this directly
no test coverage detected