safing-portmaster/status/status_test.go
2019-01-29 16:20:06 +01:00

34 lines
1 KiB
Go

package status
import "testing"
func TestStatus(t *testing.T) {
setSelectedSecurityLevel(SecurityLevelOff)
if FmtActiveSecurityLevel() != "Dynamic" {
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
}
setSelectedSecurityLevel(SecurityLevelDynamic)
AddOrUpdateThreat(&Threat{MitigationLevel: SecurityLevelSecure})
if FmtActiveSecurityLevel() != "Dynamic*" {
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
}
setSelectedSecurityLevel(SecurityLevelSecure)
if FmtActiveSecurityLevel() != "Secure" {
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
}
setSelectedSecurityLevel(SecurityLevelSecure)
AddOrUpdateThreat(&Threat{MitigationLevel: SecurityLevelFortress})
if FmtActiveSecurityLevel() != "Secure*" {
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
}
setSelectedSecurityLevel(SecurityLevelFortress)
if FmtActiveSecurityLevel() != "Fortress" {
t.Errorf("unexpected string representation: %s", FmtActiveSecurityLevel())
}
}