diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/TestBase.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/TestBase.cs | 25 |
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(); } |