22 lines
645 B
Go
22 lines
645 B
Go
package cardpackage
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/consts"
|
|
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model/entity"
|
|
)
|
|
|
|
func TestValidateRenewCardStatusRejectsStoppedCard(t *testing.T) {
|
|
err := validateRenewCardStatus("89860401788404184188", &entity.TSimCardInfo{
|
|
BossCardStatus: consts.V3ApiSimBossCardStatusStopped,
|
|
})
|
|
if err == nil {
|
|
t.Fatal("validateRenewCardStatus() error = nil, want stopped card error")
|
|
}
|
|
if !strings.Contains(err.Error(), "当前为停机状态") {
|
|
t.Fatalf("validateRenewCardStatus() error = %q, want stopped card error", err.Error())
|
|
}
|
|
}
|