23 lines
790 B
Go
23 lines
790 B
Go
|
|
package gas
|
||
|
|
|
||
|
|
import "testing"
|
||
|
|
|
||
|
|
// TestSupportedTicketValues 验证气站端工单枚举白名单。
|
||
|
|
func TestSupportedTicketValues(t *testing.T) {
|
||
|
|
for _, category := range []string{"delivery", "installation", "repair", "inspection", "reinspection", "customer_service"} {
|
||
|
|
if !isSupportedTicketCategory(category) {
|
||
|
|
t.Fatalf("标准工单分类未通过校验:%s", category)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
for _, priority := range []string{"low", "normal", "high", "urgent"} {
|
||
|
|
if !isSupportedTicketPriority(priority) {
|
||
|
|
t.Fatalf("标准工单优先级未通过校验:%s", priority)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
for _, value := range []string{"", "unknown", " normal "} {
|
||
|
|
if isSupportedTicketCategory(value) || isSupportedTicketPriority(value) {
|
||
|
|
t.Fatalf("非标准工单枚举不应通过校验:%q", value)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|