func TestVersion(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", "json", NewTestHandler("json", assert))
	assert.Nil(err)
	// Perform test requests.
	req := restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	resp := ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertHeaderEquals("Version", "1.0.0")

	req = restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	req.AddHeader("Version", "2")
	resp = ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertHeaderEquals("Version", "2.0.0")

	req = restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	req.AddHeader("Version", "3.0")
	resp = ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertHeaderEquals("Version", "4.0.0-alpha")
}
// TestVersion tests request and response version.
TestVersion tests request and response version.
// TestVersion tests request and response version .
func TestVersion(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	mux := newMultiplexer(assert)
	ts := restaudit.StartServer(mux, assert)
	defer ts.Close()
	err := mux.Register("test", "json", NewTestHandler("json", assert))
	assert.Nil(err)
	req := restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	resp := ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertHeaderEquals("Version", "1.0.0")
	req = restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	req.AddHeader("Version", "2")
	resp = ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertHeaderEquals("Version", "2.0.0")
	req = restaudit.NewRequest("GET", "/base/test/json/4711?foo=0815")
	req.AddHeader(restaudit.HeaderAccept, restaudit.ApplicationJSON)
	req.AddHeader("Version", "3.0")
	resp = ts.DoRequest(req)
	resp.AssertStatusEquals(200)
	resp.AssertHeaderEquals("Version", "4.0.0-alpha")
}
func TestVersion ( 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 ( " " , " " ) req . AddHeader ( restaudit . HeaderAccept , restaudit . ApplicationJSON ) resp := ts . DoRequest ( req ) resp . AssertStatusEquals ( 200 ) resp . AssertHeaderEquals ( " " , " " ) req = restaudit . NewRequest ( " " , " " ) req . AddHeader ( restaudit . HeaderAccept , restaudit . ApplicationJSON ) req . AddHeader ( " " , " " ) resp = ts . DoRequest ( req ) resp . AssertStatusEquals ( 200 ) resp . AssertHeaderEquals ( " " , " " ) req = restaudit . NewRequest ( " " , " " ) req . AddHeader ( restaudit . HeaderAccept , restaudit . ApplicationJSON ) req . AddHeader ( " " , " " ) resp = ts . DoRequest ( req ) resp . AssertStatusEquals ( 200 ) resp . AssertHeaderEquals ( " " , " " ) }
TestVersion tests request and response version.
TestVersion tests request and response version .
// Setup the test server. // Perform test requests.