summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/TestBase.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-01-08 13:32:17 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-01-08 13:32:17 -0800
commitc09c717665b8bb08bde6b3741b2d7a21242ffb6c (patch)
tree871a9c53bb4a90398e593dd89fa544083b8a5d89 /src/DotNetOpenAuth.Test/TestBase.cs
parent64eeddafbcb546ff0a175675d55dc8c8ee4ec141 (diff)
parent623f8a1e53a1fd1bb58f540c226d1538dc5e86a5 (diff)
downloadDotNetOpenAuth-c09c717665b8bb08bde6b3741b2d7a21242ffb6c.zip
DotNetOpenAuth-c09c717665b8bb08bde6b3741b2d7a21242ffb6c.tar.gz
DotNetOpenAuth-c09c717665b8bb08bde6b3741b2d7a21242ffb6c.tar.bz2
Merge branch 'nunit' into master-Dev10
Diffstat (limited to 'src/DotNetOpenAuth.Test/TestBase.cs')
-rw-r--r--src/DotNetOpenAuth.Test/TestBase.cs25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/DotNetOpenAuth.Test/TestBase.cs b/src/DotNetOpenAuth.Test/TestBase.cs
index c6508f6..ff96d1a 100644
--- a/src/DotNetOpenAuth.Test/TestBase.cs
+++ b/src/DotNetOpenAuth.Test/TestBase.cs
@@ -5,13 +5,14 @@
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Test {
+ using System;
using System.IO;
using System.Reflection;
using System.Web;
using DotNetOpenAuth.Messaging.Reflection;
using DotNetOpenAuth.OAuth.Messages;
using log4net;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
+ using NUnit.Framework;
/// <summary>
/// The base class that all test classes inherit from.
@@ -20,17 +21,21 @@ namespace DotNetOpenAuth.Test {
/// <summary>
/// The full path to the directory that contains the test ASP.NET site.
/// </summary>
- internal static readonly string TestWebDirectory = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\..\src\DotNetOpenAuth.TestWeb"));
+ internal string TestWebDirectory {
+ get {
+ // System.IO.Path.GetDirectoryName(new System.Uri(basePath).LocalPath)
+ string basePath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
+ string relativePath = @"src\DotNetOpenAuth.TestWeb";
+ for (int i = 0; !Directory.Exists(Path.Combine(basePath, relativePath)) && i < 4; i++) {
+ relativePath = "..\\" + relativePath;
+ }
+ return Path.GetFullPath(relativePath);
+ }
+ }
private MessageDescriptionCollection messageDescriptions = new MessageDescriptionCollection();
/// <summary>
- /// Gets or sets the test context which provides
- /// information about and functionality for the current test run.
- /// </summary>
- public TestContext TestContext { get; set; }
-
- /// <summary>
/// Gets the logger that tests should use.
/// </summary>
internal static ILog TestLogger {
@@ -44,7 +49,7 @@ namespace DotNetOpenAuth.Test {
/// <summary>
/// The TestInitialize method for the test cases.
/// </summary>
- [TestInitialize]
+ [SetUp]
public virtual void SetUp() {
log4net.Config.XmlConfigurator.Configure(Assembly.GetExecutingAssembly().GetManifestResourceStream("DotNetOpenAuth.Test.Logging.config"));
MessageBase.LowSecurityMode = true;
@@ -55,7 +60,7 @@ namespace DotNetOpenAuth.Test {
/// <summary>
/// The TestCleanup method for the test cases.
/// </summary>
- [TestCleanup]
+ [TearDown]
public virtual void Cleanup() {
log4net.LogManager.Shutdown();
}