123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- package third
- import (
- "testing"
- )
- func TestGetUserInfoPlus(t *testing.T) {
- type args struct {
- key string
- }
- tests := []struct {
- name string
- args args
- want bool
- wantErr bool
- }{
- // TODO: Add test cases.
- {
- name: "ok",
- args: args{""},
- want: true,
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := GetUserInfoPlus()
- if (err != nil) != tt.wantErr {
- t.Errorf("GetParseStatus() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if got != tt.want {
- t.Errorf("GetParseStatus() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func Test_GetRecords(t *testing.T) {
- type args struct {
- key string
- }
- tests := []struct {
- name string
- args args
- want bool
- wantErr bool
- }{
- // TODO: Add test cases.
- {
- name: "ok",
- args: args{"tzlbndf9pi7ebzky"},
- want: true,
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := GetRecords(tt.args.key)
- if (err != nil) != tt.wantErr {
- t.Errorf("getRecords() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if got == nil {
- t.Errorf("getRecords() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestPurchasePaperPlusProxy(t *testing.T) {
- type args struct {
- card string
- source string
- }
- tests := []struct {
- name string
- args args
- want *PurchasePaperPlusProxyRespondParam
- wantErr bool
- }{
- // TODO: Add test cases.
- {
- name: "ok",
- args: args{"tzlbndf9pi7ebzky", "https://blog.csdn.net/mopmgerg54mo/article/details/145314910"},
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := PurchasePaperPlusProxy(tt.args.card, tt.args.source)
- if (err != nil) != tt.wantErr {
- t.Errorf("PurchasePaperPlusProxy() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if got.Code != 200 {
- t.Errorf("PurchasePaperPlusProxy() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetTaskPrice(t *testing.T) {
- type args struct {
- source string
- }
- tests := []struct {
- name string
- args args
- want *GeTaskPriceRespondParam
- wantErr bool
- }{
- // TODO: Add test cases.
- {
- name: "ok",
- args: args{"https://blog.csdn.net/mopmgerg54mo/article/details/145314910"},
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := GetTaskPrice(tt.args.source)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetTaskPrice() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if got.Code != 200 {
- t.Errorf("GetTaskPrice() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
- func TestGetCountProxy(t *testing.T) {
- type args struct {
- Key string
- }
- tests := []struct {
- name string
- args args
- want *GetCountProxyRespondParam
- wantErr bool
- }{
- // TODO: Add test cases.
- {
- name: "ok",
- args: args{"tzlbndf9pi7ebzky"},
- wantErr: false,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- got, err := GetCountProxy(tt.args.Key)
- if (err != nil) != tt.wantErr {
- t.Errorf("GetCountProxy() error = %v, wantErr %v", err, tt.wantErr)
- return
- }
- if got.Code != 200 {
- t.Errorf("GetCountProxy() got = %v, want %v", got, tt.want)
- }
- })
- }
- }
|