github.com/goplus/yap@v0.8.1/ytest/demo/basic/gop_autogen_test.go (about)

     1  // Code generated by gop (Go+); DO NOT EDIT.
     2  
     3  package main
     4  
     5  import (
     6  	"github.com/goplus/yap/ytest"
     7  	"github.com/qiniu/x/stringutil"
     8  	"testing"
     9  )
    10  
    11  type case_foo struct {
    12  	ytest.CaseApp
    13  }
    14  //line ytest/demo/basic/foo_ytest.gox:1
    15  func (this *case_foo) Main() {
    16  //line ytest/demo/basic/foo_ytest.gox:1:1
    17  	server := new(foo)
    18  //line ytest/demo/basic/foo_ytest.gox:2:1
    19  	server.Main()
    20  //line ytest/demo/basic/foo_ytest.gox:3:1
    21  	this.RunMock("foo.com", server)
    22  //line ytest/demo/basic/foo_ytest.gox:5:1
    23  	this.Run("get /p/$id", func() {
    24  //line ytest/demo/basic/foo_ytest.gox:6:1
    25  		id := "123"
    26  //line ytest/demo/basic/foo_ytest.gox:7:1
    27  		this.Get(stringutil.Concat("http://foo.com/p/", id))
    28  //line ytest/demo/basic/foo_ytest.gox:8:1
    29  		this.RetWith(200)
    30  //line ytest/demo/basic/foo_ytest.gox:9:1
    31  		this.Json(map[string]string{"id": id})
    32  	})
    33  }
    34  func (this *case_foo) Classfname() string {
    35  	return "foo"
    36  }
    37  func Test_foo(t *testing.T) {
    38  	ytest.Gopt_CaseApp_TestMain(new(case_foo), t)
    39  }