Sub Test_HttpRequest_IsBoundReflectsBindState() Dim httpRequest Set httpRequest = New HttpRequest AssertFalse httpRequest.IsBound, "IsBound should be False before Bind" httpRequest.Bind New FakeAspRequest AssertTrue httpRequest.IsBound, "IsBound should be True after Bind" End Sub Sub Test_HttpRequest_ProxiesServerVariable() Dim httpRequest Dim fakeRequest Set fakeRequest = New FakeAspRequest fakeRequest.SetServerVariable "SERVER_NAME", "example.local" Set httpRequest = New HttpRequest httpRequest.Bind fakeRequest AssertEquals "example.local", httpRequest.ServerVariable("SERVER_NAME"), "ServerVariable should proxy to the bound request" End Sub Sub Test_HttpRequest_ProxiesQueryStringAndForm() Dim httpRequest Dim fakeRequest Set fakeRequest = New FakeAspRequest fakeRequest.SetQueryString "q", "hello" fakeRequest.SetForm "f", "world" Set httpRequest = New HttpRequest httpRequest.Bind fakeRequest AssertEquals "hello", httpRequest.QueryString("q"), "QueryString should proxy to the bound request" AssertEquals "world", httpRequest.Form("f"), "Form should proxy to the bound request" End Sub Sub Test_HttpRequest_ItemUsesRequestDefaultLookup() Dim httpRequest Dim fakeRequest Set fakeRequest = New FakeAspRequest fakeRequest.SetForm "name", "Ada" Set httpRequest = New HttpRequest httpRequest.Bind fakeRequest AssertEquals "Ada", httpRequest.Item("name"), "Item should fall through to the request's default lookup" End Sub Sub Test_HttpRequest_AccessingBeforeBindRaises() Dim httpRequest Dim discard Dim didRaise Set httpRequest = New HttpRequest didRaise = False On Error Resume Next Err.Clear discard = httpRequest.ServerVariable("SERVER_NAME") If Err.Number <> 0 Then didRaise = True Err.Clear On Error Goto 0 AssertTrue didRaise, "Accessing an unbound HttpRequest should raise" End Sub RunTest "HttpRequest: IsBound reflects Bind state", "Test_HttpRequest_IsBoundReflectsBindState" RunTest "HttpRequest: ServerVariable proxies to bound request", "Test_HttpRequest_ProxiesServerVariable" RunTest "HttpRequest: QueryString and Form proxy to bound request", "Test_HttpRequest_ProxiesQueryStringAndForm" RunTest "HttpRequest: Item uses the request's default lookup", "Test_HttpRequest_ItemUsesRequestDefaultLookup" RunTest "HttpRequest: accessing before Bind raises", "Test_HttpRequest_AccessingBeforeBindRaises"