Browse files

Getting Tests/App.config and unit tests working using it.

  • Loading branch information...
1 parent 42ca3d3 commit 6546849b53dbb395d041382a9673deccfc7636ce @ftgp ftgp committed Sep 23, 2009
Showing with 62 additions and 61 deletions.
  1. +1 −0 .gitignore
  2. +55 −55 Divan.sln
  3. 0 Tests/{App.config → App.config.template}
  4. +3 −3 Tests/CouchTest.cs
  5. +3 −3 Tests/Lucene/CouchLuceneTest.cs
View
1 .gitignore
@@ -12,6 +12,7 @@ _ReSharper.*
*.userprefs
*.usertasks
*.pidb
+*.config
config.log
TestResult.xml
test-results
View
110 Divan.sln
@@ -1,55 +1,55 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan", "src\Divan.csproj", "{37AC0B66-5340-4B81-BC62-3EE80233A011}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trivial", "samples\Trivial\Trivial.csproj", "{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan.Test", "Tests\Divan.Test.csproj", "{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.Build.0 = Release|Any CPU
- {37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.Build.0 = Release|Any CPU
- {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(MonoDevelopProperties) = preSolution
- version = 0.1
- StartupItem = src\Divan.csproj
- Policies = $0
- $0.DotNetNamingPolicy = $1
- $1.DirectoryNamespaceAssociation = None
- $1.ResourceNamePolicy = FileFormatDefault
- $0.StandardHeader = $2
- $2.Text =
- $2.inheritsSet = MITX11License
- $0.TextStylePolicy = $3
- $3.FileWidth = 120
- $3.TabWidth = 4
- $3.TabsToSpaces = False
- $3.NoTabsAfterNonTabs = False
- $3.RemoveTrailingWhitespace = False
- $3.EolMarker = Native
- $0.ChangeLogPolicy = $4
- $4.UpdateMode = None
- $4.MessageStyle = $5
- $5.LineAlign = 0
- $4.inheritsSet = Mono
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan", "src\Divan.csproj", "{37AC0B66-5340-4B81-BC62-3EE80233A011}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trivial", "samples\Trivial\Trivial.csproj", "{CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Divan.Test", "Tests\Divan.Test.csproj", "{09FB3192-8F25-4112-A8BB-93C83F6C3DDD}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {09FB3192-8F25-4112-A8BB-93C83F6C3DDD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {37AC0B66-5340-4B81-BC62-3EE80233A011}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {37AC0B66-5340-4B81-BC62-3EE80233A011}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CDCC7924-F227-46DC-B2E6-2BBE06B84AF2}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ version = 0.1
+ StartupItem = src\Divan.csproj
+ Policies = $0
+ $0.DotNetNamingPolicy = $1
+ $1.DirectoryNamespaceAssociation = None
+ $1.ResourceNamePolicy = FileFormatDefault
+ $0.StandardHeader = $2
+ $2.Text =
+ $2.inheritsSet = MITX11License
+ $0.TextStylePolicy = $3
+ $3.FileWidth = 120
+ $3.TabWidth = 4
+ $3.TabsToSpaces = False
+ $3.NoTabsAfterNonTabs = False
+ $3.RemoveTrailingWhitespace = False
+ $3.EolMarker = Native
+ $0.ChangeLogPolicy = $4
+ $4.UpdateMode = None
+ $4.MessageStyle = $5
+ $5.LineAlign = 0
+ $4.inheritsSet = Mono
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
View
0 Tests/App.config → Tests/App.config.template
File renamed without changes.
View
6 Tests/CouchTest.cs
@@ -15,7 +15,7 @@ namespace Divan.Test
/// the Tests/App.config file.
///
/// Run from command line using something like:
- /// nunit-console2 --labels -run=Divan.CouchTest Tests/bin/Debug/Tests.dll
+ /// nunit-console2 --labels -run=Divan.Test.CouchTest Tests/bin/Debug/Tests.dll
/// </summary>
[TestFixture]
public class CouchTest
@@ -25,8 +25,8 @@ public class CouchTest
[SetUp]
public void SetUp()
{
- var host = ConfigurationManager.AppSettings["CouchHost"];
- var port = Convert.ToInt32(ConfigurationManager.AppSettings["CouchPort"]);
+ var host = ConfigurationManager.AppSettings["CouchHost"] ?? "localhost";
+ var port = Convert.ToInt32(ConfigurationManager.AppSettings["CouchPort"] ?? "5984");
server = new CouchServer(host, port);
db = server.GetNewDatabase(DbName);
}
View
6 Tests/Lucene/CouchLuceneTest.cs
@@ -12,7 +12,7 @@ namespace Divan.Test.Lucene
/// Unit tests for the Lucene part in Divan. Operates in a separate CouchDB database called divan_lucene_unit_tests.
/// Requires a working Couchdb-Lucene installation according to Couchdb-Lucene's documentation.
/// Run from command line using something like:
- /// nunit-console2 --labels -run=Divan.Lucene src/bin/Debug/Divan.dll
+ /// nunit-console2 --labels -run=Divan.Test.Lucene src/bin/Debug/Divan.dll
/// </summary>
[TestFixture]
public class CouchLuceneTest
@@ -22,8 +22,8 @@ public class CouchLuceneTest
[SetUp]
public void SetUp()
{
- var host = ConfigurationManager.AppSettings["CouchHost"];
- var port = Convert.ToInt32(ConfigurationManager.AppSettings["CouchPort"]);
+ var host = ConfigurationManager.AppSettings["CouchHost"] ?? "localhost";
+ var port = Convert.ToInt32(ConfigurationManager.AppSettings["CouchPort"] ?? "5984");
server = new CouchServer(host, port);
db = server.GetNewDatabase(DbName);
}

0 comments on commit 6546849

Please sign in to comment.