Blame view

src/components/net/http_test.go 381 Bytes
62d5d847   zhangqijia   http服务只用写actionSt...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  package net
  
  import (
  	"github.com/gin-gonic/gin"
  	"testing"
  )
  
  type HttpAction struct {
  }
  
  func (h *HttpAction) PrintA(c *gin.Context) (int, interface{}) {
  	return 0, "I'm A"
  }
  func (h *HttpAction) PrintB(c *gin.Context) (int, interface{}) {
  	return 0, "I'm B"
  }
  
  func TestHttpServer_Start(t *testing.T) {
  	web := NewHttpServer("v1")
  	web.BindHandler(&HttpAction{})
  	web.Start()
  }