Skip to content
Browse files

Restructured project directory

  • Loading branch information...
1 parent fe47530 commit 97b0449db43a1033af9ac1c4f5957f1b9a96f24d Martin Rue committed Feb 21, 2011
Showing with 4,864 additions and 4,729 deletions.
  1. +45 −52 .gitignore
  2. 0 README → readme.md
  3. +100 −100 { → src}/tinyweb.framework.sln
  4. +92 −92 { → src}/tinyweb.framework.tests/Extensions/ExtensionsTests.cs
  5. +49 −49 { → src}/tinyweb.framework.tests/HandlerFactory/DefaultHandlerFactoryTests.cs
  6. +26 −26 { → src}/tinyweb.framework.tests/HandlerFactory/HandlerFactoryTests.cs
  7. +52 −52 { → src}/tinyweb.framework.tests/HandlerInvoker/DefaultHandlerInvokerTests.cs
  8. +26 −26 { → src}/tinyweb.framework.tests/HandlerInvoker/HandlerInvokerTests.cs
  9. +103 −103 { → src}/tinyweb.framework.tests/HandlerInvoker/MethodInvokerTests.cs
  10. +42 −42 { → src}/tinyweb.framework.tests/HandlerResult/FileResultTests.cs
  11. +23 −23 { → src}/tinyweb.framework.tests/HandlerResult/HtmlResultTests.cs
  12. +40 −40 { → src}/tinyweb.framework.tests/HandlerResult/JsonResultTests.cs
  13. +41 −41 { → src}/tinyweb.framework.tests/HandlerResult/RedirectResultTests.cs
  14. +21 −21 { → src}/tinyweb.framework.tests/HandlerResult/StringResultTests.cs
  15. +79 −79 { → src}/tinyweb.framework.tests/HandlerScanner/DefaultHandlerScannerTests.cs
  16. +26 −26 { → src}/tinyweb.framework.tests/HandlerScanner/HandlerScannerTests.cs
  17. +94 −94 { → src}/tinyweb.framework.tests/Helpers/ContextHelpers.cs
  18. +11 −11 { → src}/tinyweb.framework.tests/Helpers/ObjectHelper.cs
  19. +61 −61 { → src}/tinyweb.framework.tests/Init/InitTests.cs
  20. +27 −27 { → src}/tinyweb.framework.tests/Init/InitWithRegistriesTests.cs
  21. +36 −36 { → src}/tinyweb.framework.tests/Properties/AssemblyInfo.cs
  22. +11 −11 { → src}/tinyweb.framework.tests/Test Data/HandlerFactories/CustomHandlerFactory.cs
  23. +12 −12 { → src}/tinyweb.framework.tests/Test Data/HandlerInvoker/CustomHandlerInvoker.cs
  24. 0 { → src}/tinyweb.framework.tests/Test Data/HandlerResult/Files/Download.txt
  25. 0 { → src}/tinyweb.framework.tests/Test Data/HandlerResult/Files/Download.unknown
  26. +8 −8 { → src}/tinyweb.framework.tests/Test Data/HandlerResult/Json/CustomType.cs
  27. 0 { → src}/tinyweb.framework.tests/Test Data/HandlerResult/Views/View.html
  28. +12 −12 { → src}/tinyweb.framework.tests/Test Data/HandlerScanners/CustomHandlerScanner.cs
  29. +9 −9 { → src}/tinyweb.framework.tests/Test Data/Handlers/ConventionHandler.cs
  30. +6 −6 { → src}/tinyweb.framework.tests/Test Data/Handlers/InvalidHandler.cs
  31. +41 −41 { → src}/tinyweb.framework.tests/Test Data/Handlers/InvokeHandler.cs
  32. +11 −11 { → src}/tinyweb.framework.tests/Test Data/Handlers/NoDefaultCtorHandler.cs
  33. +16 −16 { → src}/tinyweb.framework.tests/Test Data/Handlers/Resource1Handler.cs
  34. +11 −11 { → src}/tinyweb.framework.tests/Test Data/Handlers/Resource2Handler.cs
  35. +11 −11 { → src}/tinyweb.framework.tests/Test Data/Handlers/Resource3Handler.cs
  36. +10 −10 { → src}/tinyweb.framework.tests/Test Data/Init/BarRepository.cs
  37. +10 −10 { → src}/tinyweb.framework.tests/Test Data/Init/FooRepository.cs
  38. +7 −7 { → src}/tinyweb.framework.tests/Test Data/Init/IBarRepository.cs
  39. +7 −7 { → src}/tinyweb.framework.tests/Test Data/Init/IFooRepository.cs
  40. +14 −14 { → src}/tinyweb.framework.tests/Test Data/Init/StructureMap/BarRegistry.cs
  41. +14 −14 { → src}/tinyweb.framework.tests/Test Data/Init/StructureMap/FooRegistry.cs
  42. +114 −114 { → src}/tinyweb.framework.tests/tinyweb.framework.tests.csproj
  43. +9 −9 { → src}/tinyweb.framework/Enums/HttpVerb.cs
  44. +11 −11 { → src}/tinyweb.framework/Exceptions/NoParameterlessConstructor.cs
  45. +54 −54 { → src}/tinyweb.framework/Extensions/Extensions.cs
  46. +11 −11 { → src}/tinyweb.framework/HandlerFactory/DefaultHandlerFactory.cs
  47. +16 −16 { → src}/tinyweb.framework/HandlerFactory/HandlerFactory.cs
  48. +6 −6 { → src}/tinyweb.framework/HandlerFactory/IHandlerFactory.cs
  49. +138 −138 { → src}/tinyweb.framework/HandlerInvoker/DefaultHandlerInvoker.cs
  50. +16 −16 { → src}/tinyweb.framework/HandlerInvoker/HandlerInvoker.cs
  51. +8 −8 { → src}/tinyweb.framework/HandlerInvoker/IHandlerInvoker.cs
  52. +34 −34 { → src}/tinyweb.framework/HandlerResult/Factory/Result.cs
  53. +57 −57 { → src}/tinyweb.framework/HandlerResult/FileResult.cs
  54. +40 −40 { → src}/tinyweb.framework/HandlerResult/HtmlResult.cs
  55. +6 −6 { → src}/tinyweb.framework/HandlerResult/Interface/HandlerResultType.cs
  56. +11 −11 { → src}/tinyweb.framework/HandlerResult/Interface/IHandlerResult.cs
  57. +40 −40 { → src}/tinyweb.framework/HandlerResult/JsonResult.cs
  58. +78 −78 { → src}/tinyweb.framework/HandlerResult/RedirectResult.cs
  59. +33 −33 { → src}/tinyweb.framework/HandlerResult/StringResult.cs
  60. +66 −66 { → src}/tinyweb.framework/HandlerScanner/DefaultHandlerScanner.cs
  61. +16 −16 { → src}/tinyweb.framework/HandlerScanner/HandlerScanner.cs
  62. +8 −8 { → src}/tinyweb.framework/HandlerScanner/IHandlerScanner.cs
  63. +10 −10 { → src}/tinyweb.framework/HandlerScanner/Models/HandlerData.cs
  64. +48 −48 { → src}/tinyweb.framework/Init/HttpHandler.cs
  65. +13 −13 { → src}/tinyweb.framework/Init/Route.cs
  66. +19 −19 { → src}/tinyweb.framework/Init/RouteHandler.cs
  67. +40 −40 { → src}/tinyweb.framework/Init/Tinyweb.cs
  68. +36 −36 { → src}/tinyweb.framework/Properties/AssemblyInfo.cs
  69. +84 −84 { → src}/tinyweb.framework/tinyweb.framework.csproj
  70. +76 −76 { → src}/tinyweb.samples.formpost/Content/Style.css
  71. +1 −1 { → src}/tinyweb.samples.formpost/Global.asax
  72. +13 −13 { → src}/tinyweb.samples.formpost/Global.asax.cs
  73. +19 −19 { → src}/tinyweb.samples.formpost/Handlers/UserRegistrationHandler.cs
  74. +9 −9 { → src}/tinyweb.samples.formpost/Models/UserRegistrationModel.cs
  75. +35 −35 { → src}/tinyweb.samples.formpost/Properties/AssemblyInfo.cs
  76. +22 −22 { → src}/tinyweb.samples.formpost/Views/Complete.spark
  77. +22 −22 { → src}/tinyweb.samples.formpost/Views/Master.spark
  78. +36 −36 { → src}/tinyweb.samples.formpost/Views/Register.spark
  79. +29 −29 {tinyweb.samples.ndjango → src/tinyweb.samples.formpost}/Web.Debug.config
  80. +30 −30 {tinyweb.samples.nhaml → src/tinyweb.samples.formpost}/Web.Release.config
  81. +19 −19 {tinyweb.samples.ndjango → src/tinyweb.samples.formpost}/Web.config
  82. +116 −116 { → src}/tinyweb.samples.formpost/tinyweb.samples.formpost.csproj
  83. +50 −50 { → src}/tinyweb.samples.ndjango/Content/Style.css
  84. +1 −1 { → src}/tinyweb.samples.ndjango/Global.asax
  85. +13 −13 { → src}/tinyweb.samples.ndjango/Global.asax.cs
  86. +15 −15 { → src}/tinyweb.samples.ndjango/Handlers/HomeHandler.cs
  87. +35 −35 { → src}/tinyweb.samples.ndjango/Properties/AssemblyInfo.cs
  88. +23 −23 { → src}/tinyweb.samples.ndjango/Views/Index.django
  89. +22 −22 { → src}/tinyweb.samples.ndjango/Views/Master.django
  90. +29 −29 {tinyweb.samples.formpost → src/tinyweb.samples.ndjango}/Web.Debug.config
  91. +30 −30 {tinyweb.samples.prg → src/tinyweb.samples.ndjango}/Web.Release.config
  92. +19 −19 {tinyweb.samples.formpost → src/tinyweb.samples.ndjango}/Web.config
  93. +122 −122 { → src}/tinyweb.samples.ndjango/tinyweb.samples.ndjango.csproj
  94. +1 −1 { → src}/tinyweb.samples.nhaml/Global.asax
  95. +13 −13 { → src}/tinyweb.samples.nhaml/Global.asax.cs
  96. +15 −15 { → src}/tinyweb.samples.nhaml/Handers/HomeHandler.cs
  97. +34 −34 { → src}/tinyweb.samples.nhaml/Properties/AssemblyInfo.cs
  98. +3 −3 { → src}/tinyweb.samples.nhaml/Views/Index.haml
  99. +29 −29 { → src}/tinyweb.samples.nhaml/Web.Debug.config
  100. +30 −30 {tinyweb.samples.formpost → src/tinyweb.samples.nhaml}/Web.Release.config
  101. +19 −19 { → src}/tinyweb.samples.nhaml/Web.config
  102. +115 −115 { → src}/tinyweb.samples.nhaml/tinyweb.samples.nhaml.csproj
  103. +1 −1 { → src}/tinyweb.samples.prg/Global.asax
  104. +13 −13 { → src}/tinyweb.samples.prg/Global.asax.cs
  105. +11 −11 { → src}/tinyweb.samples.prg/Handlers/AfterPostHandler.cs
  106. +16 −16 { → src}/tinyweb.samples.prg/Handlers/HomeHandler.cs
  107. +34 −34 { → src}/tinyweb.samples.prg/Properties/AssemblyInfo.cs
  108. +12 −12 { → src}/tinyweb.samples.prg/Views/Post.html
  109. +29 −29 { → src}/tinyweb.samples.prg/Web.Debug.config
  110. +30 −30 {tinyweb.samples.ndjango → src/tinyweb.samples.prg}/Web.Release.config
  111. +19 −19 { → src}/tinyweb.samples.prg/Web.config
  112. +110 −110 { → src}/tinyweb.samples.prg/tinyweb.samples.prg.csproj
  113. +50 −50 { → src}/tinyweb.samples.spark/Content/Style.css
  114. 0 { → src}/tinyweb.samples.spark/Global.asax
  115. +13 −13 { → src}/tinyweb.samples.spark/Global.asax.cs
  116. +15 −15 { → src}/tinyweb.samples.spark/Handlers/HomeHandler.cs
  117. +33 −33 { → src}/tinyweb.samples.spark/Properties/AssemblyInfo.cs
  118. +18 −18 { → src}/tinyweb.samples.spark/Views/Index.spark
  119. +22 −22 { → src}/tinyweb.samples.spark/Views/Master.spark
  120. +30 −0 src/tinyweb.samples.spark/Web.Debug.config
  121. +31 −0 src/tinyweb.samples.spark/Web.Release.config
  122. +19 −19 { → src}/tinyweb.samples.spark/Web.config
  123. +114 −114 { → src}/tinyweb.samples.spark/tinyweb.samples.spark.csproj
  124. +1 −1 { → src}/tinyweb.samples.structuremap/Global.asax
  125. +13 −13 { → src}/tinyweb.samples.structuremap/Global.asax.cs
  126. +18 −18 { → src}/tinyweb.samples.structuremap/Handlers/HomeHandler.cs
  127. +35 −35 { → src}/tinyweb.samples.structuremap/Properties/AssemblyInfo.cs
  128. +9 −9 { → src}/tinyweb.samples.structuremap/Services/HelloService.cs
  129. +6 −6 { → src}/tinyweb.samples.structuremap/Services/IHelloService.cs
  130. +18 −18 { → src}/tinyweb.samples.structuremap/StructureMap/Registry.cs
  131. +30 −0 src/tinyweb.samples.structuremap/Web.Debug.config
  132. +31 −0 src/tinyweb.samples.structuremap/Web.Release.config
  133. +20 −0 src/tinyweb.samples.structuremap/Web.config
  134. +108 −108 { → src}/tinyweb.samples.structuremap/tinyweb.samples.structuremap.csproj
  135. +38 −38 { → src}/tinyweb.viewengine.ndjango/NDjangoCompiler.cs
  136. +82 −82 { → src}/tinyweb.viewengine.ndjango/NDjangoResult.cs
  137. +35 −35 { → src}/tinyweb.viewengine.ndjango/Properties/AssemblyInfo.cs
  138. +14 −14 { → src}/tinyweb.viewengine.ndjango/View.cs
  139. +71 −71 { → src}/tinyweb.viewengine.ndjango/tinyweb.viewengine.ndjango.csproj
  140. +24 −24 { → src}/tinyweb.viewengine.nhaml/NHamlCompiler.cs
  141. +95 −95 { → src}/tinyweb.viewengine.nhaml/NHamlResult.cs
  142. +8 −8 { → src}/tinyweb.viewengine.nhaml/NHamlView.cs
  143. +35 −35 { → src}/tinyweb.viewengine.nhaml/Properties/AssemblyInfo.cs
  144. +14 −14 { → src}/tinyweb.viewengine.nhaml/View.cs
  145. +65 −65 { → src}/tinyweb.viewengine.nhaml/tinyweb.viewengine.nhaml.csproj
  146. +35 −35 { → src}/tinyweb.viewengine.spark/Properties/AssemblyInfo.cs
  147. +54 −54 { → src}/tinyweb.viewengine.spark/SparkCompiler.cs
  148. +101 −101 { → src}/tinyweb.viewengine.spark/SparkResult.cs
  149. +13 −13 { → src}/tinyweb.viewengine.spark/SparkView.cs
Sorry, we could not display the entire diff because it was too big.
View
97 .gitignore
@@ -1,53 +1,46 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350
-{\fonttbl\f0\fnil\fcharset0 Menlo-Regular;}
-{\colortbl;\red255\green255\blue255;\red234\green234\blue234;}
-\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0
-\deftab720
-\pard\pardeftab720\sl360
+#OS junk files
+[Tt]humbs.db
+*.DS_Store
-\f0\fs28 \cf0 \cb2 #OS junk files\
-[Tt]humbs.db\
-*.DS_Store\
-\
-#Visual Studio files\
-*.[Oo]bj\
-*.exe\
-*.pdb\
-*.user\
-*.aps\
-*.pch\
-*.vspscc\
-*.vssscc\
-*_i.c\
-*_p.c\
-*.ncb\
-*.suo\
-*.tlb\
-*.tlh\
-*.bak\
-*.[Cc]ache\
-*.ilk\
-*.log\
-*.lib\
-*.sbr\
-*.sdf\
-ipch/\
-obj/\
-[Bb]in\
-[Dd]ebug*/\
-[Rr]elease*/\
-Ankh.NoLoad\
-\
-#Tooling\
-_ReSharper*/\
-*.resharper\
-[Tt]est[Rr]esult*\
-\
-#Project files\
-[Bb]uild/\
-\
-#Subversion files\
-.svn\
-\
-# Office Temp Files\
-~$*}
+#Visual Studio files
+*.[Oo]bj
+*.exe
+*.pdb
+*.user
+*.aps
+*.pch
+*.vspscc
+*.vssscc
+*_i.c
+*_p.c
+*.ncb
+*.suo
+*.tlb
+*.tlh
+*.bak
+*.[Cc]ache
+*.ilk
+*.log
+*.lib
+*.sbr
+*.sdf
+ipch/
+obj/
+[Bb]in
+[Dd]ebug*/
+[Rr]elease*/
+Ankh.NoLoad
+
+#Tooling
+_ReSharper*/
+*.resharper
+[Tt]est[Rr]esult*
+
+#Project files
+[Bb]uild/
+
+#Subversion files
+.svn
+
+# Office Temp Files
+~$*
View
0 README → readme.md
File renamed without changes.
View
200 tinyweb.framework.sln → src/tinyweb.framework.sln
@@ -1,100 +1,100 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.framework", "tinyweb.framework\tinyweb.framework.csproj", "{4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.framework.tests", "tinyweb.framework.tests\tinyweb.framework.tests.csproj", "{87A2D951-4CD1-4689-A962-2F17B8216598}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.spark", "tinyweb.samples.spark\tinyweb.samples.spark.csproj", "{F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.structuremap", "tinyweb.samples.structuremap\tinyweb.samples.structuremap.csproj", "{DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.formpost", "tinyweb.samples.formpost\tinyweb.samples.formpost.csproj", "{48594A4F-DA1A-410A-A1C9-E7C030A820A0}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{8C95564A-19F1-444C-B831-CBBBE5C40379}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.prg", "tinyweb.samples.prg\tinyweb.samples.prg.csproj", "{E4299504-D385-406D-9591-94C0878ECFEA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.nhaml", "tinyweb.samples.nhaml\tinyweb.samples.nhaml.csproj", "{7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.spark", "tinyweb.viewengine.spark\tinyweb.viewengine.spark.csproj", "{1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.nhaml", "tinyweb.viewengine.nhaml\tinyweb.viewengine.nhaml.csproj", "{01FF632C-154F-49B2-A98C-7C2977C24370}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.tests", "tinyweb.viewengine.tests\tinyweb.viewengine.tests.csproj", "{199E3341-9C62-4767-AE1D-465167495F2E}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{87A7F3C9-C3E0-4AA0-AC6B-206209233E2E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.ndjango", "tinyweb.viewengine.ndjango\tinyweb.viewengine.ndjango.csproj", "{14B2949E-89A8-4923-A284-D112056F7E24}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.ndjango", "tinyweb.samples.ndjango\tinyweb.samples.ndjango.csproj", "{6F6CBEE1-6858-4971-874F-86E2AF8D3904}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Release|Any CPU.Build.0 = Release|Any CPU
- {87A2D951-4CD1-4689-A962-2F17B8216598}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {87A2D951-4CD1-4689-A962-2F17B8216598}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {87A2D951-4CD1-4689-A962-2F17B8216598}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {87A2D951-4CD1-4689-A962-2F17B8216598}.Release|Any CPU.Build.0 = Release|Any CPU
- {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Release|Any CPU.Build.0 = Release|Any CPU
- {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Release|Any CPU.Build.0 = Release|Any CPU
- {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Release|Any CPU.Build.0 = Release|Any CPU
- {E4299504-D385-406D-9591-94C0878ECFEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E4299504-D385-406D-9591-94C0878ECFEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E4299504-D385-406D-9591-94C0878ECFEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E4299504-D385-406D-9591-94C0878ECFEA}.Release|Any CPU.Build.0 = Release|Any CPU
- {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Release|Any CPU.Build.0 = Release|Any CPU
- {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Release|Any CPU.Build.0 = Release|Any CPU
- {01FF632C-154F-49B2-A98C-7C2977C24370}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {01FF632C-154F-49B2-A98C-7C2977C24370}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {01FF632C-154F-49B2-A98C-7C2977C24370}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {01FF632C-154F-49B2-A98C-7C2977C24370}.Release|Any CPU.Build.0 = Release|Any CPU
- {199E3341-9C62-4767-AE1D-465167495F2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {199E3341-9C62-4767-AE1D-465167495F2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {199E3341-9C62-4767-AE1D-465167495F2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {199E3341-9C62-4767-AE1D-465167495F2E}.Release|Any CPU.Build.0 = Release|Any CPU
- {14B2949E-89A8-4923-A284-D112056F7E24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {14B2949E-89A8-4923-A284-D112056F7E24}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {14B2949E-89A8-4923-A284-D112056F7E24}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {14B2949E-89A8-4923-A284-D112056F7E24}.Release|Any CPU.Build.0 = Release|Any CPU
- {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
- {48594A4F-DA1A-410A-A1C9-E7C030A820A0} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
- {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
- {E4299504-D385-406D-9591-94C0878ECFEA} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
- {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
- {6F6CBEE1-6858-4971-874F-86E2AF8D3904} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
- {87A2D951-4CD1-4689-A962-2F17B8216598} = {87A7F3C9-C3E0-4AA0-AC6B-206209233E2E}
- {199E3341-9C62-4767-AE1D-465167495F2E} = {87A7F3C9-C3E0-4AA0-AC6B-206209233E2E}
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.framework", "tinyweb.framework\tinyweb.framework.csproj", "{4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.framework.tests", "tinyweb.framework.tests\tinyweb.framework.tests.csproj", "{87A2D951-4CD1-4689-A962-2F17B8216598}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.spark", "tinyweb.samples.spark\tinyweb.samples.spark.csproj", "{F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.structuremap", "tinyweb.samples.structuremap\tinyweb.samples.structuremap.csproj", "{DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.formpost", "tinyweb.samples.formpost\tinyweb.samples.formpost.csproj", "{48594A4F-DA1A-410A-A1C9-E7C030A820A0}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{8C95564A-19F1-444C-B831-CBBBE5C40379}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.prg", "tinyweb.samples.prg\tinyweb.samples.prg.csproj", "{E4299504-D385-406D-9591-94C0878ECFEA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.nhaml", "tinyweb.samples.nhaml\tinyweb.samples.nhaml.csproj", "{7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.spark", "tinyweb.viewengine.spark\tinyweb.viewengine.spark.csproj", "{1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.nhaml", "tinyweb.viewengine.nhaml\tinyweb.viewengine.nhaml.csproj", "{01FF632C-154F-49B2-A98C-7C2977C24370}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.tests", "tinyweb.viewengine.tests\tinyweb.viewengine.tests.csproj", "{199E3341-9C62-4767-AE1D-465167495F2E}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{87A7F3C9-C3E0-4AA0-AC6B-206209233E2E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.viewengine.ndjango", "tinyweb.viewengine.ndjango\tinyweb.viewengine.ndjango.csproj", "{14B2949E-89A8-4923-A284-D112056F7E24}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tinyweb.samples.ndjango", "tinyweb.samples.ndjango\tinyweb.samples.ndjango.csproj", "{6F6CBEE1-6858-4971-874F-86E2AF8D3904}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4FEB7B17-C089-48A3-BA86-D70B24CCEB9B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {87A2D951-4CD1-4689-A962-2F17B8216598}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {87A2D951-4CD1-4689-A962-2F17B8216598}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {87A2D951-4CD1-4689-A962-2F17B8216598}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {87A2D951-4CD1-4689-A962-2F17B8216598}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727}.Release|Any CPU.Build.0 = Release|Any CPU
+ {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {48594A4F-DA1A-410A-A1C9-E7C030A820A0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E4299504-D385-406D-9591-94C0878ECFEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E4299504-D385-406D-9591-94C0878ECFEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E4299504-D385-406D-9591-94C0878ECFEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E4299504-D385-406D-9591-94C0878ECFEA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1BE68BD1-5AE8-4900-B3C5-C792EB76BF3F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {01FF632C-154F-49B2-A98C-7C2977C24370}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {01FF632C-154F-49B2-A98C-7C2977C24370}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {01FF632C-154F-49B2-A98C-7C2977C24370}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {01FF632C-154F-49B2-A98C-7C2977C24370}.Release|Any CPU.Build.0 = Release|Any CPU
+ {199E3341-9C62-4767-AE1D-465167495F2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {199E3341-9C62-4767-AE1D-465167495F2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {199E3341-9C62-4767-AE1D-465167495F2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {199E3341-9C62-4767-AE1D-465167495F2E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {14B2949E-89A8-4923-A284-D112056F7E24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {14B2949E-89A8-4923-A284-D112056F7E24}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {14B2949E-89A8-4923-A284-D112056F7E24}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {14B2949E-89A8-4923-A284-D112056F7E24}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6F6CBEE1-6858-4971-874F-86E2AF8D3904}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {DD975FBE-69B5-4D6E-BE5E-EE6E9C314727} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
+ {48594A4F-DA1A-410A-A1C9-E7C030A820A0} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
+ {F46CF6D4-BD6A-4A97-AB4D-D804713AD6DC} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
+ {E4299504-D385-406D-9591-94C0878ECFEA} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
+ {7FDD7DB0-FE8B-49AF-BA7A-AFD3AA9C1388} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
+ {6F6CBEE1-6858-4971-874F-86E2AF8D3904} = {8C95564A-19F1-444C-B831-CBBBE5C40379}
+ {87A2D951-4CD1-4689-A962-2F17B8216598} = {87A7F3C9-C3E0-4AA0-AC6B-206209233E2E}
+ {199E3341-9C62-4767-AE1D-465167495F2E} = {87A7F3C9-C3E0-4AA0-AC6B-206209233E2E}
+ EndGlobalSection
+EndGlobal
View
184 ...ework.tests/Extensions/ExtensionsTests.cs → ...ework.tests/Extensions/ExtensionsTests.cs
@@ -1,93 +1,93 @@
-using System.Collections.Generic;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class ExtensionsTests
- {
- [Test]
- public void ForEach_WithCollectionOf0_Iterates0Times()
- {
- var totalIterations = 0;
- var listOfNumbers = new List<int>();
-
- listOfNumbers.ForEach(number => totalIterations++);
-
- Assert.That(totalIterations, Is.EqualTo(0));
- }
-
- [Test]
- public void ForEach_WithCollectionOf1_Iterates1Time()
- {
- var totalIterations = 0;
- var listOfNumbers = new[] { 1 };
-
- listOfNumbers.ForEach(number => totalIterations++);
-
- Assert.That(totalIterations, Is.EqualTo(1));
- }
-
- [Test]
- public void ForEach_WithCollectionOf10_Iterates10Times()
- {
- var totalIterations = 0;
- var listOfNumbers = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
-
- listOfNumbers.ForEach(number => totalIterations++);
-
- Assert.That(totalIterations, Is.EqualTo(10));
- }
-
- [Test]
- public void With_WithPlaceholder_ReplacesPlaceholderWithArguments()
- {
- Assert.That("Hello {0}".With("World"), Is.EqualTo("Hello World"));
- }
-
- [Test]
- public void With_WithNoPlaceholders_ReturnsOriginalString()
- {
- Assert.That("Hello World".With(), Is.EqualTo("Hello World"));
- }
-
- [Test]
- public void ToEnum_WithString_ShouldReturnHttpVerbEquivalent()
- {
- Assert.That("get".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.GET));
- Assert.That("PoSt".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.POST));
- Assert.That("PUT".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.PUT));
- Assert.That("Delete".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.DELETE));
- }
-
- [Test]
- public void Name_WithEnum_ShouldReturnStringEquivalent()
- {
- Assert.That(HttpVerb.GET.Name(), Is.EqualTo("GET"));
- Assert.That(HttpVerb.POST.Name(), Is.EqualTo("POST"));
- Assert.That(HttpVerb.PUT.Name(), Is.EqualTo("PUT"));
- Assert.That(HttpVerb.DELETE.Name(), Is.EqualTo("DELETE"));
- }
-
- [Test]
- public void CastInt_WithEnum_ShouldReturnEnumIntegerValue()
- {
- Assert.That(HttpVerb.GET.CastInt(), Is.EqualTo(0));
- Assert.That(HttpVerb.POST.CastInt(), Is.EqualTo(1));
- Assert.That(HttpVerb.PUT.CastInt(), Is.EqualTo(2));
- Assert.That(HttpVerb.DELETE.CastInt(), Is.EqualTo(3));
- }
-
- [Test]
- public void IsEmpty_WithNonEmptyString_ReturnsFalse()
- {
- Assert.That("Non-empty".IsEmpty(), Is.False);
- }
-
- [Test]
- public void IsEmpty_WithEmptyString_ReturnsTrue()
- {
- Assert.That("".IsEmpty(), Is.True);
- }
- }
+using System.Collections.Generic;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class ExtensionsTests
+ {
+ [Test]
+ public void ForEach_WithCollectionOf0_Iterates0Times()
+ {
+ var totalIterations = 0;
+ var listOfNumbers = new List<int>();
+
+ listOfNumbers.ForEach(number => totalIterations++);
+
+ Assert.That(totalIterations, Is.EqualTo(0));
+ }
+
+ [Test]
+ public void ForEach_WithCollectionOf1_Iterates1Time()
+ {
+ var totalIterations = 0;
+ var listOfNumbers = new[] { 1 };
+
+ listOfNumbers.ForEach(number => totalIterations++);
+
+ Assert.That(totalIterations, Is.EqualTo(1));
+ }
+
+ [Test]
+ public void ForEach_WithCollectionOf10_Iterates10Times()
+ {
+ var totalIterations = 0;
+ var listOfNumbers = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+
+ listOfNumbers.ForEach(number => totalIterations++);
+
+ Assert.That(totalIterations, Is.EqualTo(10));
+ }
+
+ [Test]
+ public void With_WithPlaceholder_ReplacesPlaceholderWithArguments()
+ {
+ Assert.That("Hello {0}".With("World"), Is.EqualTo("Hello World"));
+ }
+
+ [Test]
+ public void With_WithNoPlaceholders_ReturnsOriginalString()
+ {
+ Assert.That("Hello World".With(), Is.EqualTo("Hello World"));
+ }
+
+ [Test]
+ public void ToEnum_WithString_ShouldReturnHttpVerbEquivalent()
+ {
+ Assert.That("get".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.GET));
+ Assert.That("PoSt".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.POST));
+ Assert.That("PUT".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.PUT));
+ Assert.That("Delete".ToEnum<HttpVerb>(), Is.EqualTo(HttpVerb.DELETE));
+ }
+
+ [Test]
+ public void Name_WithEnum_ShouldReturnStringEquivalent()
+ {
+ Assert.That(HttpVerb.GET.Name(), Is.EqualTo("GET"));
+ Assert.That(HttpVerb.POST.Name(), Is.EqualTo("POST"));
+ Assert.That(HttpVerb.PUT.Name(), Is.EqualTo("PUT"));
+ Assert.That(HttpVerb.DELETE.Name(), Is.EqualTo("DELETE"));
+ }
+
+ [Test]
+ public void CastInt_WithEnum_ShouldReturnEnumIntegerValue()
+ {
+ Assert.That(HttpVerb.GET.CastInt(), Is.EqualTo(0));
+ Assert.That(HttpVerb.POST.CastInt(), Is.EqualTo(1));
+ Assert.That(HttpVerb.PUT.CastInt(), Is.EqualTo(2));
+ Assert.That(HttpVerb.DELETE.CastInt(), Is.EqualTo(3));
+ }
+
+ [Test]
+ public void IsEmpty_WithNonEmptyString_ReturnsFalse()
+ {
+ Assert.That("Non-empty".IsEmpty(), Is.False);
+ }
+
+ [Test]
+ public void IsEmpty_WithEmptyString_ReturnsTrue()
+ {
+ Assert.That("".IsEmpty(), Is.True);
+ }
+ }
}
View
98 ...dlerFactory/DefaultHandlerFactoryTests.cs → ...dlerFactory/DefaultHandlerFactoryTests.cs
@@ -1,50 +1,50 @@
-using StructureMap;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class DefaultHandlerFactoryTests
- {
- IHandlerFactory defaultHandlerFactory;
-
- [SetUp]
- public void Setup()
- {
- defaultHandlerFactory = new DefaultHandlerFactory();
- }
-
- [Test]
- public void Create_WithResource1HandlerRequest_CreatesInstanceOfResource1Handler()
- {
- var handler = defaultHandlerFactory.Create(new HandlerData { Type = typeof(Resource1Handler) });
-
- Assert.IsInstanceOf<Resource1Handler>(handler);
- }
-
- [Test]
- public void Create_WithResource2HandlerRequest_CreatesInstanceOfResource2Handler()
- {
- var handler = defaultHandlerFactory.Create(new HandlerData { Type = typeof(Resource2Handler) });
-
- Assert.IsInstanceOf<Resource2Handler>(handler);
- }
-
- [Test]
- public void Create_WithResource3HandlerRequest_CreatesInstanceOfResource3Handler()
- {
- var handler = defaultHandlerFactory.Create(new HandlerData { Type = typeof(Resource3Handler) });
-
- Assert.IsInstanceOf<Resource3Handler>(handler);
- }
-
- [Test]
- public void Create_WithNoDefaultCtorHandlerRequest_ThrowsNoParameterlessConstructorException()
- {
- Assert.Throws<StructureMapException>(() =>
- {
- defaultHandlerFactory.Create(new HandlerData { Type = typeof(NoDefaultCtorHandler) });
- });
- }
- }
+using StructureMap;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class DefaultHandlerFactoryTests
+ {
+ IHandlerFactory defaultHandlerFactory;
+
+ [SetUp]
+ public void Setup()
+ {
+ defaultHandlerFactory = new DefaultHandlerFactory();
+ }
+
+ [Test]
+ public void Create_WithResource1HandlerRequest_CreatesInstanceOfResource1Handler()
+ {
+ var handler = defaultHandlerFactory.Create(new HandlerData { Type = typeof(Resource1Handler) });
+
+ Assert.IsInstanceOf<Resource1Handler>(handler);
+ }
+
+ [Test]
+ public void Create_WithResource2HandlerRequest_CreatesInstanceOfResource2Handler()
+ {
+ var handler = defaultHandlerFactory.Create(new HandlerData { Type = typeof(Resource2Handler) });
+
+ Assert.IsInstanceOf<Resource2Handler>(handler);
+ }
+
+ [Test]
+ public void Create_WithResource3HandlerRequest_CreatesInstanceOfResource3Handler()
+ {
+ var handler = defaultHandlerFactory.Create(new HandlerData { Type = typeof(Resource3Handler) });
+
+ Assert.IsInstanceOf<Resource3Handler>(handler);
+ }
+
+ [Test]
+ public void Create_WithNoDefaultCtorHandlerRequest_ThrowsNoParameterlessConstructorException()
+ {
+ Assert.Throws<StructureMapException>(() =>
+ {
+ defaultHandlerFactory.Create(new HandlerData { Type = typeof(NoDefaultCtorHandler) });
+ });
+ }
+ }
}
View
52 ...sts/HandlerFactory/HandlerFactoryTests.cs → ...sts/HandlerFactory/HandlerFactoryTests.cs
@@ -1,27 +1,27 @@
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class HandlerFactoryTests
- {
- [TearDown]
- public void TearDown()
- {
- HandlerFactory.SetHandlerFactory(new DefaultHandlerFactory());
- }
-
- [Test]
- public void Current_WhenRequested_ReturnsDefaultHandlerFactory()
- {
- Assert.IsInstanceOf<DefaultHandlerFactory>(HandlerFactory.Current);
- }
-
- [Test]
- public void Current_WhenSetToCustomHandlerFactory_ReturnsCustomHandlerFactory()
- {
- HandlerFactory.SetHandlerFactory(new CustomHandlerFactory());
- Assert.IsInstanceOf<CustomHandlerFactory>(HandlerFactory.Current);
- }
- }
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class HandlerFactoryTests
+ {
+ [TearDown]
+ public void TearDown()
+ {
+ HandlerFactory.SetHandlerFactory(new DefaultHandlerFactory());
+ }
+
+ [Test]
+ public void Current_WhenRequested_ReturnsDefaultHandlerFactory()
+ {
+ Assert.IsInstanceOf<DefaultHandlerFactory>(HandlerFactory.Current);
+ }
+
+ [Test]
+ public void Current_WhenSetToCustomHandlerFactory_ReturnsCustomHandlerFactory()
+ {
+ HandlerFactory.SetHandlerFactory(new CustomHandlerFactory());
+ Assert.IsInstanceOf<CustomHandlerFactory>(HandlerFactory.Current);
+ }
+ }
}
View
104 ...dlerInvoker/DefaultHandlerInvokerTests.cs → ...dlerInvoker/DefaultHandlerInvokerTests.cs
@@ -1,53 +1,53 @@
-using System.Web;
-using System.Web.Routing;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class DefaultHandlerInvokerTests2
- {
- IHandlerInvoker defaultHandlerInvoker;
- RequestContext requestContext;
-
- [SetUp]
- public void Setup()
- {
- defaultHandlerInvoker = new DefaultHandlerInvoker();
-
- requestContext = new RequestContext();
- requestContext.HttpContext = MvcMockHelpers.FakeHttpContext();
- }
-
- [Test]
- public void Execute_WithHttpGETOnResource1Handler_CallsHandlerGetMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext.Request.SetHttpMethodResult("GET");
-
- var result = defaultHandlerInvoker.Execute(new Resource1Handler(), requestContext);
-
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("Get"));
- }
-
- [Test]
- public void Execute_WithHttpPOSTOnResource1Handler_CallsHandlerGetMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext.Request.SetHttpMethodResult("POST");
-
- var result = defaultHandlerInvoker.Execute(new Resource1Handler(), requestContext);
-
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("Post"));
- }
-
- [Test]
- public void Execute_WithHttpDELETEOnResource1Handler_ThrowsHttp501Error()
- {
- requestContext.HttpContext.Request.SetHttpMethodResult("DELETE");
-
- var exception = Assert.Throws<HttpException>(() => defaultHandlerInvoker.Execute(new Resource1Handler(), requestContext));
- Assert.That(exception.Message, Is.EqualTo("The request could not be completed because the resource does not support DELETE"));
- }
- }
+using System.Web;
+using System.Web.Routing;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class DefaultHandlerInvokerTests2
+ {
+ IHandlerInvoker defaultHandlerInvoker;
+ RequestContext requestContext;
+
+ [SetUp]
+ public void Setup()
+ {
+ defaultHandlerInvoker = new DefaultHandlerInvoker();
+
+ requestContext = new RequestContext();
+ requestContext.HttpContext = MvcMockHelpers.FakeHttpContext();
+ }
+
+ [Test]
+ public void Execute_WithHttpGETOnResource1Handler_CallsHandlerGetMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext.Request.SetHttpMethodResult("GET");
+
+ var result = defaultHandlerInvoker.Execute(new Resource1Handler(), requestContext);
+
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("Get"));
+ }
+
+ [Test]
+ public void Execute_WithHttpPOSTOnResource1Handler_CallsHandlerGetMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext.Request.SetHttpMethodResult("POST");
+
+ var result = defaultHandlerInvoker.Execute(new Resource1Handler(), requestContext);
+
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("Post"));
+ }
+
+ [Test]
+ public void Execute_WithHttpDELETEOnResource1Handler_ThrowsHttp501Error()
+ {
+ requestContext.HttpContext.Request.SetHttpMethodResult("DELETE");
+
+ var exception = Assert.Throws<HttpException>(() => defaultHandlerInvoker.Execute(new Resource1Handler(), requestContext));
+ Assert.That(exception.Message, Is.EqualTo("The request could not be completed because the resource does not support DELETE"));
+ }
+ }
}
View
52 ...sts/HandlerInvoker/HandlerInvokerTests.cs → ...sts/HandlerInvoker/HandlerInvokerTests.cs
@@ -1,27 +1,27 @@
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class HandlerInvokerTests
- {
- [TearDown]
- public void TearDown()
- {
- HandlerInvoker.SetHandlerInvoker(new DefaultHandlerInvoker());
- }
-
- [Test]
- public void Current_WhenRequested_ReturnsDefaultHandlerInvoker()
- {
- Assert.IsInstanceOf<DefaultHandlerInvoker>(HandlerInvoker.Current);
- }
-
- [Test]
- public void Current_WhenSetToCustomHandlerInvoker_ReturnsCustomHandlerScanner()
- {
- HandlerInvoker.SetHandlerInvoker(new CustomHandlerInvoker());
- Assert.IsInstanceOf<CustomHandlerInvoker>(HandlerInvoker.Current);
- }
- }
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class HandlerInvokerTests
+ {
+ [TearDown]
+ public void TearDown()
+ {
+ HandlerInvoker.SetHandlerInvoker(new DefaultHandlerInvoker());
+ }
+
+ [Test]
+ public void Current_WhenRequested_ReturnsDefaultHandlerInvoker()
+ {
+ Assert.IsInstanceOf<DefaultHandlerInvoker>(HandlerInvoker.Current);
+ }
+
+ [Test]
+ public void Current_WhenSetToCustomHandlerInvoker_ReturnsCustomHandlerScanner()
+ {
+ HandlerInvoker.SetHandlerInvoker(new CustomHandlerInvoker());
+ Assert.IsInstanceOf<CustomHandlerInvoker>(HandlerInvoker.Current);
+ }
+ }
}
View
206 ...ests/HandlerInvoker/MethodInvokerTests.cs → ...ests/HandlerInvoker/MethodInvokerTests.cs
@@ -1,104 +1,104 @@
-using System.Collections.Specialized;
-using System.Web.Routing;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class MethodInvokerTests
- {
- IHandlerInvoker defaultHandlerInvoker;
- RequestContext requestContext;
-
- [SetUp]
- public void Setup()
- {
- defaultHandlerInvoker = new DefaultHandlerInvoker();
-
- requestContext = new RequestContext();
- requestContext.RouteData = new RouteData();
- }
-
- [Test]
- public void HttpGET_WithQueryStringParameters_CallsHandlerGetMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { {"param1", "1"}, {"param2", "world"} });
- requestContext.HttpContext.Request.SetHttpMethodResult("GET");
-
- var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
-
- Assert.That(result, Is.InstanceOf<StringResult>());
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("1world"));
- }
-
- [Test]
- public void HttpGET_WithFormPostParameters_CallsHandlerGetMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(formData: new NameValueCollection { { "param1", "5" }, { "param2", "times" } });
- requestContext.HttpContext.Request.SetHttpMethodResult("GET");
-
- var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
-
- Assert.That(result, Is.InstanceOf<StringResult>());
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("5times"));
- }
-
- [Test]
- public void HttpGET_WithRouteDataParameters_CallsHandlerGetMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext = MvcMockHelpers.FakeHttpContext();
- requestContext.RouteData.Values.Add("param1", "10");
- requestContext.RouteData.Values.Add("param2", "strings");
- requestContext.HttpContext.Request.SetHttpMethodResult("GET");
-
- var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
-
- Assert.That(result, Is.InstanceOf<StringResult>());
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("10strings"));
- }
-
- [Test]
- public void HttpPOST_WithAllParameterSources_CallsHandlerPostMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { { "param1", "42" } }, formData: new NameValueCollection { {"param2", "1.141"} });
- requestContext.RouteData.Values.Add("param3", "true");
- requestContext.HttpContext.Request.SetHttpMethodResult("POST");
-
- var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
-
- Assert.That(result, Is.InstanceOf<StringResult>());
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("421.141True"));
- }
-
- [Test]
- public void HttpPUT_WithSimpleModelParameter_CallsHandlerPutMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { { "number1", "4" }, { "number2", "5" } });
- requestContext.HttpContext.Request.SetHttpMethodResult("PUT");
-
- var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
-
- Assert.That(result, Is.InstanceOf<StringResult>());
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("Result: 9"));
- }
-
- [Test]
- public void HttpDELETE_WithComplexModelParameter_CallsHandlerDeleteMethodAndReturnsCorrectData()
- {
- requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { { "number1", "13" }, { "number2", "11" } }, formData: new NameValueCollection { { "factor", "10" } });
- requestContext.RouteData.Values.Add("label", "the total is");
- requestContext.HttpContext.Request.SetHttpMethodResult("DELETE");
-
- var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
-
- Assert.That(result, Is.InstanceOf<StringResult>());
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("the total is 240"));
- }
- }
+using System.Collections.Specialized;
+using System.Web.Routing;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class MethodInvokerTests
+ {
+ IHandlerInvoker defaultHandlerInvoker;
+ RequestContext requestContext;
+
+ [SetUp]
+ public void Setup()
+ {
+ defaultHandlerInvoker = new DefaultHandlerInvoker();
+
+ requestContext = new RequestContext();
+ requestContext.RouteData = new RouteData();
+ }
+
+ [Test]
+ public void HttpGET_WithQueryStringParameters_CallsHandlerGetMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { {"param1", "1"}, {"param2", "world"} });
+ requestContext.HttpContext.Request.SetHttpMethodResult("GET");
+
+ var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
+
+ Assert.That(result, Is.InstanceOf<StringResult>());
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("1world"));
+ }
+
+ [Test]
+ public void HttpGET_WithFormPostParameters_CallsHandlerGetMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(formData: new NameValueCollection { { "param1", "5" }, { "param2", "times" } });
+ requestContext.HttpContext.Request.SetHttpMethodResult("GET");
+
+ var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
+
+ Assert.That(result, Is.InstanceOf<StringResult>());
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("5times"));
+ }
+
+ [Test]
+ public void HttpGET_WithRouteDataParameters_CallsHandlerGetMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext = MvcMockHelpers.FakeHttpContext();
+ requestContext.RouteData.Values.Add("param1", "10");
+ requestContext.RouteData.Values.Add("param2", "strings");
+ requestContext.HttpContext.Request.SetHttpMethodResult("GET");
+
+ var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
+
+ Assert.That(result, Is.InstanceOf<StringResult>());
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("10strings"));
+ }
+
+ [Test]
+ public void HttpPOST_WithAllParameterSources_CallsHandlerPostMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { { "param1", "42" } }, formData: new NameValueCollection { {"param2", "1.141"} });
+ requestContext.RouteData.Values.Add("param3", "true");
+ requestContext.HttpContext.Request.SetHttpMethodResult("POST");
+
+ var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
+
+ Assert.That(result, Is.InstanceOf<StringResult>());
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("421.141True"));
+ }
+
+ [Test]
+ public void HttpPUT_WithSimpleModelParameter_CallsHandlerPutMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { { "number1", "4" }, { "number2", "5" } });
+ requestContext.HttpContext.Request.SetHttpMethodResult("PUT");
+
+ var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
+
+ Assert.That(result, Is.InstanceOf<StringResult>());
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("Result: 9"));
+ }
+
+ [Test]
+ public void HttpDELETE_WithComplexModelParameter_CallsHandlerDeleteMethodAndReturnsCorrectData()
+ {
+ requestContext.HttpContext = MvcMockHelpers.FakeHttpContext(queryString: new NameValueCollection { { "number1", "13" }, { "number2", "11" } }, formData: new NameValueCollection { { "factor", "10" } });
+ requestContext.RouteData.Values.Add("label", "the total is");
+ requestContext.HttpContext.Request.SetHttpMethodResult("DELETE");
+
+ var result = defaultHandlerInvoker.Execute(new InvokeHandler(), requestContext);
+
+ Assert.That(result, Is.InstanceOf<StringResult>());
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("the total is 240"));
+ }
+ }
}
View
84 ...rk.tests/HandlerResult/FileResultTests.cs → ...rk.tests/HandlerResult/FileResultTests.cs
@@ -1,43 +1,43 @@
-using System.IO;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class FileResultTests
- {
- [Test]
- public void GetResult_WhenCreatedWithNonExistentPath_ThrowsFileNotFoundException()
- {
- var exception = Assert.Throws<FileNotFoundException>(() => new FileResult("c:\\fakepath"));
- Assert.That(exception.Message, Is.EqualTo("The file at c:\\fakepath could not be found"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithPathToHtmlFile_ReturnsPathToFileAndHasDispositionHeader()
- {
- var result = new FileResult("..\\..\\Test Data\\HandlerResult\\Views\\View.html");
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.IsTrue(result.GetResult().EndsWith("\\Test Data\\HandlerResult\\Views\\View.html"));
- Assert.That(result.CustomHeaders["Content-Disposition"], Is.EqualTo("attachment; filename=View.html"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithPathToPDFFile_ReturnsPathToFileAndHasDispositionHeader()
- {
- var result = new FileResult("..\\..\\Test Data\\HandlerResult\\Files\\Download.txt");
- Assert.That(result.ContentType, Is.EqualTo("text/plain"));
- Assert.IsTrue(result.GetResult().EndsWith("\\Test Data\\HandlerResult\\Files\\Download.txt"));
- Assert.That(result.CustomHeaders["Content-Disposition"], Is.EqualTo("attachment; filename=Download.txt"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithPathToUnknownFile_ReturnsPathToFileAndHasDispositionHeader()
- {
- var result = new FileResult("..\\..\\Test Data\\HandlerResult\\Files\\Download.unknown");
- Assert.That(result.ContentType, Is.EqualTo("application/unknown"));
- Assert.IsTrue(result.GetResult().EndsWith("\\Test Data\\HandlerResult\\Files\\Download.unknown"));
- Assert.That(result.CustomHeaders["Content-Disposition"], Is.EqualTo("attachment; filename=Download.unknown"));
- }
- }
+using System.IO;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class FileResultTests
+ {
+ [Test]
+ public void GetResult_WhenCreatedWithNonExistentPath_ThrowsFileNotFoundException()
+ {
+ var exception = Assert.Throws<FileNotFoundException>(() => new FileResult("c:\\fakepath"));
+ Assert.That(exception.Message, Is.EqualTo("The file at c:\\fakepath could not be found"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithPathToHtmlFile_ReturnsPathToFileAndHasDispositionHeader()
+ {
+ var result = new FileResult("..\\..\\Test Data\\HandlerResult\\Views\\View.html");
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.IsTrue(result.GetResult().EndsWith("\\Test Data\\HandlerResult\\Views\\View.html"));
+ Assert.That(result.CustomHeaders["Content-Disposition"], Is.EqualTo("attachment; filename=View.html"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithPathToPDFFile_ReturnsPathToFileAndHasDispositionHeader()
+ {
+ var result = new FileResult("..\\..\\Test Data\\HandlerResult\\Files\\Download.txt");
+ Assert.That(result.ContentType, Is.EqualTo("text/plain"));
+ Assert.IsTrue(result.GetResult().EndsWith("\\Test Data\\HandlerResult\\Files\\Download.txt"));
+ Assert.That(result.CustomHeaders["Content-Disposition"], Is.EqualTo("attachment; filename=Download.txt"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithPathToUnknownFile_ReturnsPathToFileAndHasDispositionHeader()
+ {
+ var result = new FileResult("..\\..\\Test Data\\HandlerResult\\Files\\Download.unknown");
+ Assert.That(result.ContentType, Is.EqualTo("application/unknown"));
+ Assert.IsTrue(result.GetResult().EndsWith("\\Test Data\\HandlerResult\\Files\\Download.unknown"));
+ Assert.That(result.CustomHeaders["Content-Disposition"], Is.EqualTo("attachment; filename=Download.unknown"));
+ }
+ }
}
View
46 ...rk.tests/HandlerResult/HtmlResultTests.cs → ...rk.tests/HandlerResult/HtmlResultTests.cs
@@ -1,24 +1,24 @@
-using System.IO;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class HtmlResultTests
- {
- [Test]
- public void GetResult_WhenCreatedWithNonExistentPath_ThrowsFileNotFoundException()
- {
- var exception = Assert.Throws<FileNotFoundException>(() => new HtmlResult("c:\\fakepath"));
- Assert.That(exception.Message, Is.EqualTo("The view at c:\\fakepath could not be found"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithExistingPath_ReturnsViewData()
- {
- var result = new HtmlResult("..\\..\\Test Data\\HandlerResult\\Views\\View.html");
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- Assert.That(result.GetResult(), Is.EqualTo("<h1>View</h1>"));
- }
- }
+using System.IO;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class HtmlResultTests
+ {
+ [Test]
+ public void GetResult_WhenCreatedWithNonExistentPath_ThrowsFileNotFoundException()
+ {
+ var exception = Assert.Throws<FileNotFoundException>(() => new HtmlResult("c:\\fakepath"));
+ Assert.That(exception.Message, Is.EqualTo("The view at c:\\fakepath could not be found"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithExistingPath_ReturnsViewData()
+ {
+ var result = new HtmlResult("..\\..\\Test Data\\HandlerResult\\Views\\View.html");
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ Assert.That(result.GetResult(), Is.EqualTo("<h1>View</h1>"));
+ }
+ }
}
View
80 ...rk.tests/HandlerResult/JsonResultTests.cs → ...rk.tests/HandlerResult/JsonResultTests.cs
@@ -1,41 +1,41 @@
-using System;
-using System.Collections.Generic;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class JsonResultTests
- {
- [Test]
- public void GetResult_WhenCreatedWithNull_ReturnsEmptyString()
- {
- var result = new JsonResult(null);
- Assert.That(result.GetResult(), Is.EqualTo(String.Empty));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithAnonymousObject_ReturnsCorrectJsonRepresentation()
- {
- var result = new JsonResult(new { message = "hello world", number = 42 });
- Assert.That(result.ContentType, Is.EqualTo("text/json"));
- Assert.That(result.GetResult(), Is.EqualTo("{\"message\":\"hello world\",\"number\":42}"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithCustomObject_ReturnsCorrectJsonRepresentation()
- {
- var result = new JsonResult(new CustomType { Data = "data", Number = 50 });
- Assert.That(result.ContentType, Is.EqualTo("text/json"));
- Assert.That(result.GetResult(), Is.EqualTo("{\"Data\":\"data\",\"Number\":50}"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithCollection_ReturnsCorrectJsonRepresentation()
- {
- var result = new JsonResult(new List<CustomType> { new CustomType { Data = "data1", Number = 1 }, new CustomType { Data = "data2", Number = 2 } });
- Assert.That(result.ContentType, Is.EqualTo("text/json"));
- Assert.That(result.GetResult(), Is.EqualTo("[{\"Data\":\"data1\",\"Number\":1},{\"Data\":\"data2\",\"Number\":2}]"));
- }
- }
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class JsonResultTests
+ {
+ [Test]
+ public void GetResult_WhenCreatedWithNull_ReturnsEmptyString()
+ {
+ var result = new JsonResult(null);
+ Assert.That(result.GetResult(), Is.EqualTo(String.Empty));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithAnonymousObject_ReturnsCorrectJsonRepresentation()
+ {
+ var result = new JsonResult(new { message = "hello world", number = 42 });
+ Assert.That(result.ContentType, Is.EqualTo("text/json"));
+ Assert.That(result.GetResult(), Is.EqualTo("{\"message\":\"hello world\",\"number\":42}"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithCustomObject_ReturnsCorrectJsonRepresentation()
+ {
+ var result = new JsonResult(new CustomType { Data = "data", Number = 50 });
+ Assert.That(result.ContentType, Is.EqualTo("text/json"));
+ Assert.That(result.GetResult(), Is.EqualTo("{\"Data\":\"data\",\"Number\":50}"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithCollection_ReturnsCorrectJsonRepresentation()
+ {
+ var result = new JsonResult(new List<CustomType> { new CustomType { Data = "data1", Number = 1 }, new CustomType { Data = "data2", Number = 2 } });
+ Assert.That(result.ContentType, Is.EqualTo("text/json"));
+ Assert.That(result.GetResult(), Is.EqualTo("[{\"Data\":\"data1\",\"Number\":1},{\"Data\":\"data2\",\"Number\":2}]"));
+ }
+ }
}
View
82 ...ests/HandlerResult/RedirectResultTests.cs → ...ests/HandlerResult/RedirectResultTests.cs
@@ -1,42 +1,42 @@
-using System;
-using NUnit.Framework;
-using tinyweb.framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class RedirectResultTests
- {
- [Test]
- public void Ctor_WhenCreatedWithInvalidHandler_ThrowsException()
- {
- Tinyweb.Handlers = new[] { new HandlerData() };
-
- var exception = Assert.Throws<Exception>(() => new RedirectResult<InvalidHandler>());
- Assert.That(exception.Message, Is.EqualTo("The handler InvalidHandler was not found"));
- }
-
- [Test]
- public void Ctor_WhenCreatedWithInvalidUri_ThrowsException()
- {
- var exception = Assert.Throws<Exception>(() => new RedirectResult(String.Empty));
- Assert.That(exception.Message, Is.EqualTo("The specified redirect uri is invalid"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithValidHandler_ReturnsHandlerUri()
- {
- Tinyweb.Handlers = new[] { new HandlerData { Type = typeof(Resource1Handler), Uri = "uri" } };
-
- var result = new RedirectResult<Resource1Handler>();
- Assert.That(result.GetResult(), Is.EqualTo("uri"));
- }
-
- [Test]
- public void GetResult_WhenCreatedWithValidUri_ReturnsUri()
- {
- var result = new RedirectResult("someuri");
- Assert.That(result.GetResult(), Is.EqualTo("someuri"));
- }
- }
+using System;
+using NUnit.Framework;
+using tinyweb.framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class RedirectResultTests
+ {
+ [Test]
+ public void Ctor_WhenCreatedWithInvalidHandler_ThrowsException()
+ {
+ Tinyweb.Handlers = new[] { new HandlerData() };
+
+ var exception = Assert.Throws<Exception>(() => new RedirectResult<InvalidHandler>());
+ Assert.That(exception.Message, Is.EqualTo("The handler InvalidHandler was not found"));
+ }
+
+ [Test]
+ public void Ctor_WhenCreatedWithInvalidUri_ThrowsException()
+ {
+ var exception = Assert.Throws<Exception>(() => new RedirectResult(String.Empty));
+ Assert.That(exception.Message, Is.EqualTo("The specified redirect uri is invalid"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithValidHandler_ReturnsHandlerUri()
+ {
+ Tinyweb.Handlers = new[] { new HandlerData { Type = typeof(Resource1Handler), Uri = "uri" } };
+
+ var result = new RedirectResult<Resource1Handler>();
+ Assert.That(result.GetResult(), Is.EqualTo("uri"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreatedWithValidUri_ReturnsUri()
+ {
+ var result = new RedirectResult("someuri");
+ Assert.That(result.GetResult(), Is.EqualTo("someuri"));
+ }
+ }
}
View
42 ....tests/HandlerResult/StringResultTests.cs → ....tests/HandlerResult/StringResultTests.cs
@@ -1,22 +1,22 @@
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class StringResultTests
- {
- [Test]
- public void GetResult_WhenCreatedWithNewString_ReturnsString()
- {
- var result = new StringResult("test data");
- Assert.That(result.GetResult(), Is.EqualTo("test data"));
- }
-
- [Test]
- public void GetResult_WhenCreated_ContentTypeIsTextHtml()
- {
- var result = new StringResult("test data");
- Assert.That(result.ContentType, Is.EqualTo("text/html"));
- }
- }
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class StringResultTests
+ {
+ [Test]
+ public void GetResult_WhenCreatedWithNewString_ReturnsString()
+ {
+ var result = new StringResult("test data");
+ Assert.That(result.GetResult(), Is.EqualTo("test data"));
+ }
+
+ [Test]
+ public void GetResult_WhenCreated_ContentTypeIsTextHtml()
+ {
+ var result = new StringResult("test data");
+ Assert.That(result.ContentType, Is.EqualTo("text/html"));
+ }
+ }
}
View
158 ...dlerScanner/DefaultHandlerScannerTests.cs → ...dlerScanner/DefaultHandlerScannerTests.cs
@@ -1,80 +1,80 @@
-using System.Linq;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class DefaultHandlerScannerTests
- {
- IHandlerScanner defaultHandlerScanner;
-
- [SetUp]
- public void Setup()
- {
- defaultHandlerScanner = new DefaultHandlerScanner();
- }
-
- [Test]
- public void FindAll_WhenCalled_FindsThreeHandlers()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Count(), Is.EqualTo(5));
- }
-
- [Test]
- public void FindAll_WhenCalled_FirstHandlerTypeIsResource1Handler()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Any(h => h.Type == new Resource1Handler().GetType()));
- }
-
- [Test]
- public void FindAll_WhenCalled_FirstHandlerUriIsCorrect()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Single(h => h.Type == new Resource1Handler().GetType()).Uri == "resource1");
- }
-
- [Test]
- public void FindAll_WhenCalled_SecondHandlerTypeIsResource2Handler()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Any(h => h.Type == new Resource2Handler().GetType()));
- }
-
- [Test]
- public void FindAll_WhenCalled_SecondHandlerUriIsCorrect()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Single(h => h.Type == new Resource2Handler().GetType()).Uri == "resource2");
- }
-
- [Test]
- public void FindAll_WhenCalled_ThirdHandlerTypeIsResource3Handler()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Any(h => h.Type == new Resource3Handler().GetType()));
- }
-
- [Test]
- public void FindAll_WhenCalled_ThirdHandlerUriIsCorrect()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Single(h => h.Type == new Resource3Handler().GetType()).Uri == "resource3");
- }
-
- [Test]
- public void FindAll_WhenCalled_FourthHandlerTypeIsConventionHandler()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Any(h => h.Type == new ConventionHandler().GetType()));
- }
-
- [Test]
- public void FindAll_WhenCalled_FourthHandlerUriIsCorrect()
- {
- var handlers = defaultHandlerScanner.FindAll();
- Assert.That(handlers.Single(h => h.Type == new ConventionHandler().GetType()).Uri == "Convention");
- }
- }
+using System.Linq;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class DefaultHandlerScannerTests
+ {
+ IHandlerScanner defaultHandlerScanner;
+
+ [SetUp]
+ public void Setup()
+ {
+ defaultHandlerScanner = new DefaultHandlerScanner();
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_FindsThreeHandlers()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Count(), Is.EqualTo(5));
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_FirstHandlerTypeIsResource1Handler()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Any(h => h.Type == new Resource1Handler().GetType()));
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_FirstHandlerUriIsCorrect()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Single(h => h.Type == new Resource1Handler().GetType()).Uri == "resource1");
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_SecondHandlerTypeIsResource2Handler()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Any(h => h.Type == new Resource2Handler().GetType()));
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_SecondHandlerUriIsCorrect()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Single(h => h.Type == new Resource2Handler().GetType()).Uri == "resource2");
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_ThirdHandlerTypeIsResource3Handler()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Any(h => h.Type == new Resource3Handler().GetType()));
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_ThirdHandlerUriIsCorrect()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Single(h => h.Type == new Resource3Handler().GetType()).Uri == "resource3");
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_FourthHandlerTypeIsConventionHandler()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Any(h => h.Type == new ConventionHandler().GetType()));
+ }
+
+ [Test]
+ public void FindAll_WhenCalled_FourthHandlerUriIsCorrect()
+ {
+ var handlers = defaultHandlerScanner.FindAll();
+ Assert.That(handlers.Single(h => h.Type == new ConventionHandler().GetType()).Uri == "Convention");
+ }
+ }
}
View
52 ...sts/HandlerScanner/HandlerScannerTests.cs → ...sts/HandlerScanner/HandlerScannerTests.cs
@@ -1,27 +1,27 @@
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class HandlerScannerTests
- {
- [TearDown]
- public void TearDown()
- {
- HandlerScanner.SetHandlerScanner(new DefaultHandlerScanner());
- }
-
- [Test]
- public void Current_WhenRequested_ReturnsDefaultHandlerScanner()
- {
- Assert.IsInstanceOf<DefaultHandlerScanner>(HandlerScanner.Current);
- }
-
- [Test]
- public void Current_WhenSetToCustomHandlerScanner_ReturnsCustomHandlerScanner()
- {
- HandlerScanner.SetHandlerScanner(new CustomHandlerScanner());
- Assert.IsInstanceOf<CustomHandlerScanner>(HandlerScanner.Current);
- }
- }
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class HandlerScannerTests
+ {
+ [TearDown]
+ public void TearDown()
+ {
+ HandlerScanner.SetHandlerScanner(new DefaultHandlerScanner());
+ }
+
+ [Test]
+ public void Current_WhenRequested_ReturnsDefaultHandlerScanner()
+ {
+ Assert.IsInstanceOf<DefaultHandlerScanner>(HandlerScanner.Current);
+ }
+
+ [Test]
+ public void Current_WhenSetToCustomHandlerScanner_ReturnsCustomHandlerScanner()
+ {
+ HandlerScanner.SetHandlerScanner(new CustomHandlerScanner());
+ Assert.IsInstanceOf<CustomHandlerScanner>(HandlerScanner.Current);
+ }
+ }
}
View
188 ...framework.tests/Helpers/ContextHelpers.cs → ...framework.tests/Helpers/ContextHelpers.cs
@@ -1,95 +1,95 @@
-using System;
-using System.Collections.Specialized;
-using System.Web;
-using Moq;
-
-namespace tinyweb.framework.tests
-{
- public static class MvcMockHelpers
- {
- public static HttpContextBase FakeHttpContext(NameValueCollection queryString = null, NameValueCollection formData = null)
- {
- var context = new Mock<HttpContextBase>();
- var request = new Mock<HttpRequestBase>();
- var response = new Mock<HttpResponseBase>();
- var session = new Mock<HttpSessionStateBase>();
- var server = new Mock<HttpServerUtilityBase>();
-
- context.Setup(p => p.Request).Returns(request.Object);
- context.Setup(p => p.Response).Returns(response.Object);
- context.Setup(p => p.Session).Returns(session.Object);
- context.Setup(p => p.Server).Returns(server.Object);
-
- context.Setup(p => p.Request.QueryString).Returns(queryString != null ? new NameValueCollection(queryString) : new NameValueCollection());
- context.Setup(p => p.Request.Form).Returns(formData != null ? new NameValueCollection(formData) : new NameValueCollection());
-
- return context.Object;
- }
-
- public static HttpContextBase FakeHttpContext(string url)
- {
- HttpContextBase context = FakeHttpContext();
- context.Request.SetupRequestUrl(url);
- return context;
- }
-
- static string GetUrlFileName(string url)
- {
- if (url.Contains("?"))
- {
- return url.Substring(0, url.IndexOf("?"));
- }
- else
- {
- return url;
- }
- }
-
- static NameValueCollection GetQueryStringParameters(string url)
- {
- if (url.Contains("?"))
- {
- NameValueCollection parameters = new NameValueCollection();
-
- string[] parts = url.Split("?".ToCharArray());
- string[] keys = parts[1].Split("&".ToCharArray());
-
- foreach (string key in keys)
- {
- string[] part = key.Split("=".ToCharArray());
- parameters.Add(part[0], part[1]);
- }
-
- return parameters;
- }
- else
- {
- return null;
- }
- }
-
- public static void SetHttpMethodResult(this HttpRequestBase request, string httpMethod)
- {
- Mock.Get(request).Setup(p => p.HttpMethod).Returns(httpMethod);
- }
-
- public static void SetupRequestUrl(this HttpRequestBase request, string url)
- {
- if (url == null)
- {
- throw new ArgumentNullException("url");
- }
-
- if (!url.StartsWith("~/"))
- {
- throw new ArgumentException("Sorry, we expect a virtual url starting with \"~/\".");
- }
-
- var mock = Mock.Get(request);
-
- mock.Setup(p => p.QueryString).Returns(GetQueryStringParameters(url));
- mock.Setup(p => p.AppRelativeCurrentExecutionFilePath).Returns(GetUrlFileName(url));
- mock.Setup(p => p.PathInfo).Returns(string.Empty);
- }
- }
+using System;
+using System.Collections.Specialized;
+using System.Web;
+using Moq;
+
+namespace tinyweb.framework.tests
+{
+ public static class MvcMockHelpers
+ {
+ public static HttpContextBase FakeHttpContext(NameValueCollection queryString = null, NameValueCollection formData = null)
+ {
+ var context = new Mock<HttpContextBase>();
+ var request = new Mock<HttpRequestBase>();
+ var response = new Mock<HttpResponseBase>();
+ var session = new Mock<HttpSessionStateBase>();
+ var server = new Mock<HttpServerUtilityBase>();
+
+ context.Setup(p => p.Request).Returns(request.Object);
+ context.Setup(p => p.Response).Returns(response.Object);
+ context.Setup(p => p.Session).Returns(session.Object);
+ context.Setup(p => p.Server).Returns(server.Object);
+
+ context.Setup(p => p.Request.QueryString).Returns(queryString != null ? new NameValueCollection(queryString) : new NameValueCollection());
+ context.Setup(p => p.Request.Form).Returns(formData != null ? new NameValueCollection(formData) : new NameValueCollection());
+
+ return context.Object;
+ }
+
+ public static HttpContextBase FakeHttpContext(string url)
+ {
+ HttpContextBase context = FakeHttpContext();
+ context.Request.SetupRequestUrl(url);
+ return context;
+ }
+
+ static string GetUrlFileName(string url)
+ {
+ if (url.Contains("?"))
+ {
+ return url.Substring(0, url.IndexOf("?"));
+ }
+ else
+ {
+ return url;
+ }
+ }
+
+ static NameValueCollection GetQueryStringParameters(string url)
+ {
+ if (url.Contains("?"))
+ {
+ NameValueCollection parameters = new NameValueCollection();
+
+ string[] parts = url.Split("?".ToCharArray());
+ string[] keys = parts[1].Split("&".ToCharArray());
+
+ foreach (string key in keys)
+ {
+ string[] part = key.Split("=".ToCharArray());
+ parameters.Add(part[0], part[1]);
+ }
+
+ return parameters;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public static void SetHttpMethodResult(this HttpRequestBase request, string httpMethod)
+ {
+ Mock.Get(request).Setup(p => p.HttpMethod).Returns(httpMethod);
+ }
+
+ public static void SetupRequestUrl(this HttpRequestBase request, string url)
+ {
+ if (url == null)
+ {
+ throw new ArgumentNullException("url");
+ }
+
+ if (!url.StartsWith("~/"))
+ {
+ throw new ArgumentException("Sorry, we expect a virtual url starting with \"~/\".");
+ }
+
+ var mock = Mock.Get(request);
+
+ mock.Setup(p => p.QueryString).Returns(GetQueryStringParameters(url));
+ mock.Setup(p => p.AppRelativeCurrentExecutionFilePath).Returns(GetUrlFileName(url));
+ mock.Setup(p => p.PathInfo).Returns(string.Empty);
+ }
+ }
}
View
22 ...b.framework.tests/Helpers/ObjectHelper.cs → ...b.framework.tests/Helpers/ObjectHelper.cs
@@ -1,12 +1,12 @@
-using System.Web.Routing;
-
-namespace tinyweb.framework.tests
-{
- public static class ObjectExtensions
- {
- public static RouteValueDictionary AsRouteValueDictionary(this object input)
- {
- return new RouteValueDictionary(input);
- }
- }
+using System.Web.Routing;
+
+namespace tinyweb.framework.tests
+{
+ public static class ObjectExtensions
+ {
+ public static RouteValueDictionary AsRouteValueDictionary(this object input)
+ {
+ return new RouteValueDictionary(input);
+ }
+ }
}
View
122 tinyweb.framework.tests/Init/InitTests.cs → ...tinyweb.framework.tests/Init/InitTests.cs
@@ -1,62 +1,62 @@
-using System.Linq;
-using NUnit.Framework;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class InitTests
- {
- [SetUp]
- public void Setup()
- {
- Tinyweb.Init();
- }
-
- [Test]
- public void Initialise_WithFourHandlers_ReturnsCorrectNumberOfHandlers()
- {
- Assert.That(Tinyweb.Handlers.Count(), Is.EqualTo(5));
- }
-
- [Test]
- public void Initialise_WithResource1Handler_CorrectUriConfigured()
- {
- var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(Resource1Handler));
-
- Assert.That(handler, Is.Not.Null);
- Assert.That(handler.Uri.ToLower(), Is.EqualTo("resource1"));
- Assert.That(handler.DefaultRouteValues.AsRouteValueDictionary()["route1"], Is.EqualTo("default1"));
- Assert.That(handler.DefaultRouteValues.AsRouteValueDictionary()["route2"], Is.EqualTo("default2"));
- }
-
- [Test]
- public void Initialise_WithResource2Handler_CorrectUriConfigured()
- {
- var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(Resource2Handler));
-
- Assert.That(handler, Is.Not.Null);
- Assert.That(handler.Uri.ToLower(), Is.EqualTo("resource2"));
- Assert.That(handler.DefaultRouteValues, Is.Null);
- }
-
- [Test]
- public void Initialise_WithResource3Handler_CorrectUriConfigured()
- {
- var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(Resource3Handler));
-
- Assert.That(handler, Is.Not.Null);
- Assert.That(handler.Uri.ToLower(), Is.EqualTo("resource3"));
- Assert.That(handler.DefaultRouteValues, Is.Null);
- }
-
- [Test]
- public void Initialise_WithInvokeHandler_CorrectUriConfigured()
- {
- var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(InvokeHandler));
-
- Assert.That(handler, Is.Not.Null);
- Assert.That(handler.Uri.ToLower(), Is.EqualTo("invoke"));
- Assert.That(handler.DefaultRouteValues, Is.Null);
- }
- }
+using System.Linq;
+using NUnit.Framework;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class InitTests
+ {
+ [SetUp]
+ public void Setup()
+ {
+ Tinyweb.Init();
+ }
+
+ [Test]
+ public void Initialise_WithFourHandlers_ReturnsCorrectNumberOfHandlers()
+ {
+ Assert.That(Tinyweb.Handlers.Count(), Is.EqualTo(5));
+ }
+
+ [Test]
+ public void Initialise_WithResource1Handler_CorrectUriConfigured()
+ {
+ var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(Resource1Handler));
+
+ Assert.That(handler, Is.Not.Null);
+ Assert.That(handler.Uri.ToLower(), Is.EqualTo("resource1"));
+ Assert.That(handler.DefaultRouteValues.AsRouteValueDictionary()["route1"], Is.EqualTo("default1"));
+ Assert.That(handler.DefaultRouteValues.AsRouteValueDictionary()["route2"], Is.EqualTo("default2"));
+ }
+
+ [Test]
+ public void Initialise_WithResource2Handler_CorrectUriConfigured()
+ {
+ var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(Resource2Handler));
+
+ Assert.That(handler, Is.Not.Null);
+ Assert.That(handler.Uri.ToLower(), Is.EqualTo("resource2"));
+ Assert.That(handler.DefaultRouteValues, Is.Null);
+ }
+
+ [Test]
+ public void Initialise_WithResource3Handler_CorrectUriConfigured()
+ {
+ var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(Resource3Handler));
+
+ Assert.That(handler, Is.Not.Null);
+ Assert.That(handler.Uri.ToLower(), Is.EqualTo("resource3"));
+ Assert.That(handler.DefaultRouteValues, Is.Null);
+ }
+
+ [Test]
+ public void Initialise_WithInvokeHandler_CorrectUriConfigured()
+ {
+ var handler = Tinyweb.Handlers.SingleOrDefault(h => h.Type == typeof(InvokeHandler));
+
+ Assert.That(handler, Is.Not.Null);
+ Assert.That(handler.Uri.ToLower(), Is.EqualTo("invoke"));
+ Assert.That(handler.DefaultRouteValues, Is.Null);
+ }
+ }
}
View
54 ...ork.tests/Init/InitWithRegistriesTests.cs → ...ork.tests/Init/InitWithRegistriesTests.cs
@@ -1,27 +1,27 @@
-using NUnit.Framework;
-using StructureMap;
-
-namespace tinyweb.framework.tests
-{
- [TestFixture]
- public class InitWithRegistriesTests
- {
- [SetUp]
- public void Setup()
- {
- Tinyweb.Init(new FooRegistry(), new BarRegistry());
- }
-
- [Test]
- public void Initialise_WithTwoRegistries_ContainsTwoRegistries()
- {
- var fooRepo = ObjectFactory.GetInstance<IFooRepository>();
- var barRepo = ObjectFactory.GetInstance<IBarRepository>();
-
- Assert.That(fooRepo, Is.Not.Null);
- Assert.That(fooRepo, Is.InstanceOf<FooRepository>());
- Assert.That(barRepo, Is.Not.Null);
- Assert.That(barRepo, Is.InstanceOf<BarRepository>());
- }
- }
-}
+using NUnit.Framework;
+using StructureMap;
+
+namespace tinyweb.framework.tests
+{
+ [TestFixture]
+ public class InitWithRegistriesTests
+ {
+ [SetUp]
+ public void Setup()
+ {
+ Tinyweb.Init(new FooRegistry(), new BarRegistry());
+ }
+
+ [Test]
+ public void Initialise_WithTwoRegistries_ContainsTwoRegistries()
+ {
+ var fooRepo = ObjectFactory.GetInstance<IFooRepository>();
+ var barRepo = ObjectFactory.GetInstance<IBarRepository>();
+
+ Assert.That(fooRepo, Is.Not.Null);
+ Assert.That(fooRepo, Is.InstanceOf<FooRepository>());
+ Assert.That(barRepo, Is.Not.Null);
+ Assert.That(barRepo, Is.InstanceOf<BarRepository>());
+ }
+ }
+}
View
72 ...ramework.tests/Properties/AssemblyInfo.cs → ...ramework.tests/Properties/AssemblyInfo.cs
@@ -1,36 +1,36 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("tinyweb.framework.tests")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("tinyweb.framework.tests")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("e1c66f09-affc-4a87-a088-7ba7d911d3e0")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("tinyweb.framework.tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("tinyweb.framework.tests")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("e1c66f09-affc-4a87-a088-7ba7d911d3e0")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
View
22 .../HandlerFactories/CustomHandlerFactory.cs → .../HandlerFactories/CustomHandlerFactory.cs
@@ -1,12 +1,12 @@
-using System;
-
-namespace tinyweb.framework.tests
-{
- public class CustomHandlerFactory : IHandlerFactory
- {
- public object Create(HandlerData handlerData)
- {
- throw new NotImplementedException();
- }
- }
+using System;
+
+namespace tinyweb.framework.tests
+{
+ public class CustomHandlerFactory : IHandlerFactory
+ {
+ public object Create(HandlerData handlerData)
+ {
+ throw new NotImplementedException();
+ }
+ }
}
View
24 ...ta/HandlerInvoker/CustomHandlerInvoker.cs → ...ta/HandlerInvoker/CustomHandlerInvoker.cs
@@ -1,13 +1,13 @@
-using System;
-using System.Web.Routing;
-
-namespace tinyweb.framework.tests
-{
- public class CustomHandlerInvoker : IHandlerInvoker
- {
- public IHandlerResult Execute(object handler, RequestContext requestContext)
- {
- throw new NotImplementedException();
- }
- }
+using System;
+using System.Web.Routing;
+
+namespace tinyweb.framework.tests
+{
+ public class CustomHandlerInvoker : IHandlerInvoker
+ {
+ public IHandlerResult Execute(object handler, RequestContext requestContext)
+ {
+ throw new NotImplementedException();
+ }
+ }