mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 02:47:04 +00:00
add examples for read using custom decoder per type, read using custom decoder via iris#UnmarshalerFunc and to complete it add an example for the context#ReadXML.
Former-commit-id: 536b1780f12d0b9d9ce9aa976a0f95f18634ec2d
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/kataras/iris/httptest"
|
||||
)
|
||||
|
||||
func TestReadCustomViaUnmarshaler(t *testing.T) {
|
||||
app := newApp()
|
||||
e := httptest.New(t, app)
|
||||
|
||||
expectedResponse := `Received: main.config{Addr:"localhost:8080", ServerName:"Iris"}`
|
||||
|
||||
e.POST("/").WithText("addr: localhost:8080\nserverName: Iris").Expect().
|
||||
Status(httptest.StatusOK).Body().Equal(expectedResponse)
|
||||
}
|
||||
Reference in New Issue
Block a user