Consolidated ASP Classic MVC framework from best components
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

42 řádky
1.5KB

  1. <!-- #include file="../aspunit/Lib/ASPUnit.asp" -->
  2. <!-- #include file="../bootstrap.asp" -->
  3. <%
  4. Call ASPUnit.AddModule( _
  5. ASPUnit.CreateModule( _
  6. "Config Integration Tests", _
  7. Array( _
  8. ASPUnit.CreateTest("NestedTestPageReadsMirroredConfigValue"), _
  9. ASPUnit.CreateTest("MissingConfigKeyReturnsNothingSentinel"), _
  10. ASPUnit.CreateTest("ProductionAppBaseUrlSupportsBlankOrConfiguredValue") _
  11. ), _
  12. ASPUnit.CreateLifeCycle("SetupConfigIntegration", "TeardownConfigIntegration") _
  13. ) _
  14. )
  15. Call ASPUnit.Run()
  16. Sub SetupConfigIntegration()
  17. Call ResetTestRuntime()
  18. End Sub
  19. Sub TeardownConfigIntegration()
  20. Call ResetTestRuntime()
  21. End Sub
  22. Function NestedTestPageReadsMirroredConfigValue()
  23. Call ASPUnit.Equal(GetAppSetting("Error404RedirectSeconds"), "5", "Nested integration pages should read mirrored config values from their local web.config")
  24. End Function
  25. Function MissingConfigKeyReturnsNothingSentinel()
  26. Call ASPUnit.Equal(GetAppSetting("DefinitelyMissingSetting"), "nothing", "Missing config keys should return the existing nothing sentinel")
  27. End Function
  28. Function ProductionAppBaseUrlSupportsBlankOrConfiguredValue()
  29. Dim configuredUrl
  30. configuredUrl = GetAppSetting("ProductionAppBaseUrl")
  31. Call ASPUnit.Ok((configuredUrl = "" Or configuredUrl = "nothing" Or InStr(configuredUrl, "http://") = 1 Or InStr(configuredUrl, "https://") = 1), "ProductionAppBaseUrl should be either blank for host fallback or an explicit absolute URL")
  32. End Function
  33. %>

Powered by TurnKey Linux.