-
Notifications
You must be signed in to change notification settings - Fork 1
/
status_test.go
36 lines (27 loc) · 1.06 KB
/
status_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright © 2019, 2023 The Swedish Internet Foundation
//
// Distributed under the MIT License. (See accompanying LICENSE file or copy at
// <https://opensource.org/licenses/MIT>.)
package health
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestStatus_String(t *testing.T) {
t.Parallel()
assert.Equal(t, "pass", StatusPass.String())
assert.Equal(t, "warn", StatusWarn.String())
assert.Equal(t, "fail", StatusFail.String())
}
func TestWorstStatus(t *testing.T) {
t.Parallel()
assert.Equal(t, StatusPass, WorstStatus(StatusPass))
assert.Equal(t, StatusWarn, WorstStatus(StatusWarn))
assert.Equal(t, StatusFail, WorstStatus(StatusFail))
assert.Equal(t, StatusWarn, WorstStatus(StatusPass, StatusWarn))
assert.Equal(t, StatusFail, WorstStatus(StatusWarn, StatusFail))
assert.Equal(t, StatusFail, WorstStatus(StatusPass, StatusFail))
assert.Equal(t, StatusWarn, WorstStatus(StatusWarn, StatusWarn))
assert.Equal(t, StatusFail, WorstStatus(StatusFail, StatusWarn))
assert.Equal(t, StatusFail, WorstStatus(StatusPass, StatusFail, StatusPass))
}