mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-22 07:53:38 +01:00
24 lines
504 B
Go
24 lines
504 B
Go
|
package security
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestBasicConfig_IsValid(t *testing.T) {
|
||
|
basicConfig := &BasicConfig{
|
||
|
Username: "admin",
|
||
|
PasswordSha512Hash: Sha512("test"),
|
||
|
}
|
||
|
if !basicConfig.isValid() {
|
||
|
t.Error("basicConfig should've been valid")
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func TestBasicConfig_IsValidWhenPasswordIsInvalid(t *testing.T) {
|
||
|
basicConfig := &BasicConfig{
|
||
|
Username: "admin",
|
||
|
PasswordSha512Hash: "",
|
||
|
}
|
||
|
if basicConfig.isValid() {
|
||
|
t.Error("basicConfig shouldn't have been valid")
|
||
|
}
|
||
|
}
|