package test

import (
	"testing"
	"voucher/internal/biz/businesserr"
)

func Test_SendCoupon(t *testing.T) {
	tests := []struct {
		name string
	}{
		{
			name: "发券",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if err := SendCoupon(); err != nil {
				if ee, ok := err.(*businesserr.BusinessErr); ok {
					t.Errorf("errorcode:%s,errmsg:%s", ee.Code, ee.Message)
				}
			}
		})
	}
}

func Test_QueryCoupon(t *testing.T) {
	tests := []struct {
		name     string
		appId    string
		openId   string
		couponId string
	}{
		{
			name:     "查询券订单信息",
			appId:    "wx619991cc795028f5",
			openId:   "oSNb4fnRWr7HdgbDOO8TD66LXofE",
			couponId: "147089832782",
		},
		{
			name:     "查询券订单信息",
			appId:    "wx619991cc795028f5",
			openId:   "oSNb4foo87dBNx1D9KTH-bB-G6YA",
			couponId: "147094824239",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			QueryCoupon(tt.appId, tt.openId, tt.couponId)
		})
	}
}

func Test_QueryProduct(t *testing.T) {
	tests := []struct {
		name string
	}{
		{
			name: "查询券商品信息",
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			QueryProduct()
		})
	}
}

func Test_QueryCallback(t *testing.T) {
	tests := []struct {
		name string
	}{
		{
			name: "查询券核销通知地址",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			QueryCallback(bcFJLF)
		})
	}
}

func Test_SetCallback(t *testing.T) {
	tests := []struct {
		name string
	}{
		{
			name: "设置券核销通知地址",
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {

			SetCallback(bcFJLF)
		})
	}
}
