Consolidated ASP Classic MVC framework from best components
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

52 lignes
1.7KB

  1. <!-- #include file="../aspunit/Lib/ASPUnit.asp" -->
  2. <!-- #include file="../bootstrap.asp" -->
  3. <!-- #include file="../../core/lib.Routes.asp" -->
  4. <%
  5. Call ASPUnit.AddModule( _
  6. ASPUnit.CreateModule( _
  7. "Route Helper Integration Tests", _
  8. Array( _
  9. ASPUnit.CreateTest("RouteHelperReadsCacheBustingSettingFromConfig"), _
  10. ASPUnit.CreateTest("UrlToBuildsLowercaseControllerActionPath"), _
  11. ASPUnit.CreateTest("AssetUrlCanOverrideCacheBustingPerCall") _
  12. ), _
  13. ASPUnit.CreateLifeCycle("SetupRouteHelper", "TeardownRouteHelper") _
  14. ) _
  15. )
  16. Call ASPUnit.Run()
  17. Sub SetupRouteHelper()
  18. Call ResetTestRuntime()
  19. On Error Resume Next
  20. Set Route_Helper__Singleton = Nothing
  21. On Error GoTo 0
  22. End Sub
  23. Sub TeardownRouteHelper()
  24. On Error Resume Next
  25. Set Route_Helper__Singleton = Nothing
  26. On Error GoTo 0
  27. Call ResetTestRuntime()
  28. End Sub
  29. Function RouteHelperReadsCacheBustingSettingFromConfig()
  30. Call ASPUnit.Ok((Not Routes().CacheBustingEnabled), "Routes helper should read disabled cache-busting from tests/web.config")
  31. End Function
  32. Function UrlToBuildsLowercaseControllerActionPath()
  33. Dim url
  34. url = Routes().UrlTo("HomeController", "Index", Array("id", "7"))
  35. Call ASPUnit.Ok((InStr(LCase(url), "/homecontroller/index?id=7") > 0), "UrlTo should build a lowercase controller/action path with query parameters")
  36. End Function
  37. Function AssetUrlCanOverrideCacheBustingPerCall()
  38. Dim url
  39. url = Routes().AssetUrl("css/site.css", True)
  40. Call ASPUnit.Ok((InStr(url, "css/site.css?v=") > 0), "AssetUrl should append the configured cache-bust parameter when override is true")
  41. End Function
  42. %>

Powered by TurnKey Linux.