1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 19:07:06 +00:00

simplify by join the bind registration(ctx-transformer-to-something-func-binder and service one, which just sets the struct as it's) to one named 'In' and create a 'Child' which will return a new mvc instance with binders inheritanced from the parent one and add a simple test to the mvc_test.go - will have more later on

Former-commit-id: 81ae99390c683a61e1b0bac58725a04b9a3eebbb
This commit is contained in:
kataras
2017-11-24 17:34:35 +02:00
parent 29835d9a8e
commit 5a3be2ab58
5 changed files with 111 additions and 56 deletions

22
mvc2/mvc_test.go Normal file
View File

@@ -0,0 +1,22 @@
package mvc2_test
// black-box in combination with the handler_test
import (
"testing"
. "github.com/kataras/iris/mvc2"
)
func TestMvcInAndHandler(t *testing.T) {
m := New()
m.In(testBinderFuncUserStruct, testBinderService, testBinderFuncParam)
var (
h1 = m.Handler(testConsumeUserHandler)
h2 = m.Handler(testConsumeServiceHandler)
h3 = m.Handler(testConsumeParamHandler)
)
testAppWithMvcHandlers(t, h1, h2, h3)
}