
Некоторые проверки провалились
test / test (1.16.x) (push) Has been cancelled
test / test (1.17.x) (push) Has been cancelled
34 строки
916 Б
Go
34 строки
916 Б
Go
package models_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"git.golang1.ru/softonik/godog/colors"
|
|
"git.golang1.ru/softonik/godog/internal/models"
|
|
)
|
|
|
|
type stepResultStatusTestCase struct {
|
|
st models.StepResultStatus
|
|
str string
|
|
clr colors.ColorFunc
|
|
}
|
|
|
|
var stepResultStatusTestCases = []stepResultStatusTestCase{
|
|
{st: models.Passed, str: "passed", clr: colors.Green},
|
|
{st: models.Failed, str: "failed", clr: colors.Red},
|
|
{st: models.Skipped, str: "skipped", clr: colors.Cyan},
|
|
{st: models.Undefined, str: "undefined", clr: colors.Yellow},
|
|
{st: models.Pending, str: "pending", clr: colors.Yellow},
|
|
{st: -1, str: "unknown", clr: colors.Yellow},
|
|
}
|
|
|
|
func Test_StepResultStatus(t *testing.T) {
|
|
for _, tc := range stepResultStatusTestCases {
|
|
t.Run(tc.str, func(t *testing.T) {
|
|
assert.Equal(t, tc.str, tc.st.String())
|
|
assert.Equal(t, tc.clr(tc.str), tc.st.Color()(tc.str))
|
|
})
|
|
}
|
|
}
|