<% '******************************************************************** ' Name: ASPUnitRunner.asp ' ' Purpose: Contains the UnitRunner class which is used to render the unit testing UI '******************************************************************** '******************************************************************** ' Include Files '******************************************************************** %> <% Const ALL_TESTCONTAINERS = "All Test Containers" Const ALL_TESTCASES = "All Test Cases" Const FRAME_PARAMETER = "UnitRunner" Const FRAME_SELECTOR = "selector" Const FRAME_RESULTS = "results" Const STYLESHEET = "aspunit/include/ASPUnit.css" Const SCRIPTFILE = "aspunit/include/ASPUnitRunner.js" Class UnitRunner Private m_dicTestContainer Private Sub Class_Initialize() Set m_dicTestContainer = CreateObject("Scripting.Dictionary") End Sub Public Sub AddTestContainer(oTestContainer) m_dicTestContainer.Add TypeName(oTestContainer), oTestContainer End Sub Public Function Display() If (Request.QueryString(FRAME_PARAMETER) = FRAME_SELECTOR) Then DisplaySelector ElseIf (Request.QueryString(FRAME_PARAMETER) = FRAME_RESULTS) Then DisplayResults Else ShowFrameSet End if End Function '******************************************************************** ' Frameset '******************************************************************** Private Function ShowFrameSet() %> ASPUnit Test Runner <% End Function Private Function GetSelectorFrameSrc() GetSelectorFrameSrc = Request.ServerVariables("SCRIPT_NAME") & "?" & FRAME_PARAMETER & "=" & FRAME_SELECTOR End Function Private Function GetResultsFrameSrc() GetResultsFrameSrc = Request.ServerVariables("SCRIPT_NAME") & "?" & FRAME_PARAMETER & "=" & FRAME_RESULTS End Function '******************************************************************** ' Selector Frame '******************************************************************** Private Function DisplaySelector() %>
Test: Test Method: Show Passing Tests
<% End Function Private Function AddTestContainers() Dim oTestContainer, sTestContainer For Each oTestContainer In m_dicTestContainer.Items() sTestContainer = TypeName(oTestContainer) If (sTestContainer = Request.Form("cboTestContainers")) Then Response.Write("