func TestPutXML(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	// Setup the test server.
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	err := mux.Register("test", "xml", NewTestHandler("xml", assert))
	assert.Nil(err)
	// Perform test requests.
	req := restaudit.NewRequest("PUT", "/base/test/xml/4711")
	reqData := TestRequestData{"foo", "bar", "4711", "0815", ""}
	req.MarshalBody(assert, restaudit.ApplicationXML, reqData)
	resp := ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	respData := TestRequestData{}
	resp.AssertUnmarshalledBody(&respData)
	assert.Equal(respData, reqData)
}
// TestPutXML tests the PUT command with a XML payload and result.
TestPutXML tests the PUT command with a XML payload and result.
// TestPutXML tests the PUT command with a XML payload and result .
func TestPutXML(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	err := mux.Register("test", "xml", NewTestHandler("xml", assert))
	assert.Nil(err)
	req := restaudit.NewRequest("PUT", "/base/test/xml/4711")
	reqData := TestRequestData{"foo", "bar", "4711", "0815", ""}
	req.MarshalBody(assert, restaudit.ApplicationXML, reqData)
	resp := ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	respData := TestRequestData{}
	resp.AssertUnmarshalledBody(&respData)
	assert.Equal(respData, reqData)
}
func TestPutXML ( t * testing . T ) { assert := audit . NewTestingAssertion ( t , true ) mux := newMultiplexer ( assert ) ts := restaudit . StartServer ( mux , assert ) defer ts . Close ( ) err := mux . Register ( " " , " " , NewTestHandler ( " " , assert ) ) assert . Nil ( err ) req := restaudit . NewRequest ( " " , " " ) reqData := TestRequestData { " " , " " , " " , " " , " " } req . MarshalBody ( assert , restaudit . ApplicationXML , reqData ) resp := ts . DoRequest ( req ) resp . AssertStatusEquals ( 200 ) respData := TestRequestData { } resp . AssertUnmarshalledBody ( & respData ) assert . Equal ( respData , reqData ) }
TestPutXML tests the PUT command with a XML payload and result.
TestPutXML tests the PUT command with a XML payload and result .
// Setup the test server. // Perform test requests.