Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Sep 17, 2017
1 parent f18b13a commit 8d6d535
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 66 deletions.
41 changes: 0 additions & 41 deletions Tests/Helpers/AssemblyWeaver.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Xml.Linq;
Expand All @@ -10,41 +9,6 @@

public static class AssemblyWeaver
{
public class TestTraceListener : TraceListener
{
public TestTraceListener()
{
Trace.Listeners.Add(this);
}
public string Message;

public void Reset()
{
Message = null;
}

public override void Write(string message)
{
if (Message != null)
{
throw new Exception("More than one Debug message came through. Did you forget to reset before a test?");
}

Message = message;
}

public override void WriteLine(string message)
{
if (Message != null)
{
throw new Exception("More than one Debug message came through. Did you forget to reset before a test?");
}

Message = message;
}
}

public static TestTraceListener TestListener;
public static Assembly Assembly;
public static string BeforeAssemblyPath;
public static string BeforeSymbolPath;
Expand All @@ -59,11 +23,6 @@ public static dynamic GetInstance(string typeName)

static AssemblyWeaver()
{
TestListener = new TestTraceListener();

Debug.Listeners.Clear();
Debug.Listeners.Add(TestListener);

var testDirectory = TestContext.CurrentContext.TestDirectory;
BeforeAssemblyPath = Path.GetFullPath(Path.Combine(testDirectory, @"..\..\..\..\AssemblyToProcess\bin\Debug\net452\AssemblyToProcess.dll"));
BeforeSymbolPath = Path.ChangeExtension(BeforeAssemblyPath, "pdb");
Expand Down
6 changes: 0 additions & 6 deletions Tests/RewritingConstructors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
[TestFixture]
public class RewritingConstructors
{
[SetUp]
public void SetUp()
{
AssemblyWeaver.TestListener.Reset();
}

[Test]
public void RequiresNonNullArgument()
{
Expand Down
6 changes: 0 additions & 6 deletions Tests/RewritingIndexers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
[TestFixture]
public class RewritingIndexers
{
[SetUp]
public void SetUp()
{
AssemblyWeaver.TestListener.Reset();
}

[Test]
public void NonNullableIndexerSetterWithFirstArgumentNull()
{
Expand Down
7 changes: 0 additions & 7 deletions Tests/RewritingMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@
[TestFixture]
public class RewritingMethods
{
[SetUp]
public void SetUp()
{
AssemblyWeaver.TestListener.Reset();
}

[Test]
public void RequiresNonNullArgumentForExplicitInterface()
{
AssemblyWeaver.TestListener.Reset();
var type = AssemblyWeaver.Assembly.GetType("ClassWithExplicitInterface");
var sample = (IComparable<string>)Activator.CreateInstance(type);
var exception = Assert.Throws<ArgumentNullException>(() => sample.CompareTo(null));
Expand Down
6 changes: 0 additions & 6 deletions Tests/RewritingProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
[TestFixture]
public class RewritingProperties
{
[SetUp]
public void SetUp()
{
AssemblyWeaver.TestListener.Reset();
}

[Test]
public void PropertySetterRequiresNonNullArgument()
{
Expand Down

0 comments on commit 8d6d535

Please sign in to comment.