You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
542 B

2 months ago
package service
import (
"fmt"
"testing"
)
func TestVideoList2String(t *testing.T) {
video := VideoInHB{
Id: []byte("1"),
AuthorId: []byte("1"),
AuthorName: []byte("Tom"),
}
list := []VideoInHB{
video,
}
res := VideoList2String(list)
fmt.Println(res)
}
func TestString2VideoList(t *testing.T) {
str := "{\"id\":\"1\",\"author_id\":\"2\",\"author_name\":\"Tom\",\"title\":\"\",\"video_url\":\"\",\"cover_url\":\"\",\"timestamp\":\"\"}"
list := []string{str}
res := String2VideoList(list)
fmt.Println(res)
}