github.com/goplus/yap@v0.8.1/ytest/demo/foo/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/test" 7 "github.com/goplus/yap/ytest" 8 "github.com/qiniu/x/stringutil" 9 "testing" 10 ) 11 12 type case_bar struct { 13 ytest.CaseApp 14 } 15 type case_foo struct { 16 ytest.CaseApp 17 } 18 //line ytest/demo/foo/bar_ytest.gox:1 19 func (this *case_bar) Main() { 20 //line ytest/demo/foo/bar_ytest.gox:1:1 21 this.TestServer("foo.com", new(AppV2)) 22 //line ytest/demo/foo/bar_ytest.gox:3:1 23 id := "123" 24 //line ytest/demo/foo/bar_ytest.gox:4:1 25 this.Get(stringutil.Concat("http://foo.com/p/", id)) 26 //line ytest/demo/foo/bar_ytest.gox:5:1 27 this.Send() 28 //line ytest/demo/foo/bar_ytest.gox:6:1 29 test.Gopt_Case_MatchTBase(this, this.Resp().Code(), 200) 30 //line ytest/demo/foo/bar_ytest.gox:7:1 31 this.Json(map[string]string{"id": id}) 32 } 33 func (this *case_bar) Classfname() string { 34 return "bar" 35 } 36 //line ytest/demo/foo/foo_ytest.gox:1 37 func (this *case_foo) Main() { 38 //line ytest/demo/foo/foo_ytest.gox:1:1 39 this.Mock("foo.com", new(AppV2)) 40 //line ytest/demo/foo/foo_ytest.gox:3:1 41 id := "123" 42 //line ytest/demo/foo/foo_ytest.gox:4:1 43 this.Get(stringutil.Concat("http://foo.com/p/", id)) 44 //line ytest/demo/foo/foo_ytest.gox:5:1 45 this.RetWith(200) 46 //line ytest/demo/foo/foo_ytest.gox:6:1 47 this.Json(map[string]string{"id": id}) 48 } 49 func (this *case_foo) Classfname() string { 50 return "foo" 51 } 52 func Test_bar(t *testing.T) { 53 ytest.Gopt_CaseApp_TestMain(new(case_bar), t) 54 } 55 func Test_foo(t *testing.T) { 56 ytest.Gopt_CaseApp_TestMain(new(case_foo), t) 57 }