summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Test/TestBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOpenAuth.Test/TestBase.cs')
-rw-r--r--src/DotNetOpenAuth.Test/TestBase.cs33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/DotNetOpenAuth.Test/TestBase.cs b/src/DotNetOpenAuth.Test/TestBase.cs
index c6508f6..8aeca2d 100644
--- a/src/DotNetOpenAuth.Test/TestBase.cs
+++ b/src/DotNetOpenAuth.Test/TestBase.cs
@@ -5,38 +5,43 @@
//-----------------------------------------------------------------------
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.
/// </summary>
public class TestBase {
- /// <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"));
-
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 {
get { return TestUtilities.TestLogger; }
}
+ /// <summary>
+ /// Gets the full path to the directory that contains the test ASP.NET site.
+ /// </summary>
+ 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);
+ }
+ }
+
internal MessageDescriptionCollection MessageDescriptions {
get { return this.messageDescriptions; }
}
@@ -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();
}