summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth.Test/TestBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/DotNetOAuth.Test/TestBase.cs')
-rw-r--r--src/DotNetOAuth.Test/TestBase.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/DotNetOAuth.Test/TestBase.cs b/src/DotNetOAuth.Test/TestBase.cs
new file mode 100644
index 0000000..e41b01c
--- /dev/null
+++ b/src/DotNetOAuth.Test/TestBase.cs
@@ -0,0 +1,42 @@
+//-----------------------------------------------------------------------
+// <copyright file="TestBase.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+namespace DotNetOAuth.Test {
+ using System.Reflection;
+ using log4net;
+ using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+ /// <summary>
+ /// The base class that all test classes inherit from.
+ /// </summary>
+ public class TestBase {
+ /// <summary>
+ /// The logger that tests should use.
+ /// </summary>
+ internal static readonly ILog Logger = LogManager.GetLogger("DotNetOAuth.Test");
+
+ /// <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>
+ /// The TestInitialize method for the test cases.
+ /// </summary>
+ [TestInitialize]
+ public virtual void SetUp() {
+ log4net.Config.XmlConfigurator.Configure(Assembly.GetExecutingAssembly().GetManifestResourceStream("DotNetOAuth.Test.Logging.config"));
+ }
+
+ /// <summary>
+ /// The TestCleanup method for the test cases.
+ /// </summary>
+ [TestCleanup]
+ public virtual void Cleanup() {
+ log4net.LogManager.Shutdown();
+ }
+ }
+}