<!-- #include file="../aspunit/Lib/ASPUnit.asp" -->
<!-- #include file="../bootstrap.asp" -->
<!-- #include file="../../app/controllers/HomeController.asp" -->

<%
Call ASPUnit.AddModule( _
    ASPUnit.CreateModule( _
        "Home Controller Component Tests", _
        Array( _
            ASPUnit.CreateTest("HomeControllerDefaultsToUsingLayout"), _
            ASPUnit.CreateTest("HomeControllerDefaultTitleIsHome") _
        ), _
        ASPUnit.CreateLifeCycle("SetupHomeController", "TeardownHomeController") _
    ) _
)

Call ASPUnit.Run()

Sub SetupHomeController()
    Call ResetTestRuntime()
    On Error Resume Next
    HomeController_Class__Singleton = Empty
    On Error GoTo 0
    Call ExecuteGlobal("Dim objHomeController")
    Set objHomeController = HomeController()
End Sub

Sub TeardownHomeController()
    Set objHomeController = Nothing
    On Error Resume Next
    HomeController_Class__Singleton = Empty
    On Error GoTo 0
    Call ResetTestRuntime()
End Sub

Function HomeControllerDefaultsToUsingLayout()
    Call ASPUnit.Ok(objHomeController.useLayout, "HomeController should default to layout-enabled rendering")
End Function

Function HomeControllerDefaultTitleIsHome()
    Call ASPUnit.Equal(objHomeController.Title, "Home", "HomeController should expose the expected default title")
End Function
%>
