Skip to content

Commit

Permalink
The default message detection func is now statically set to avoid hav…
Browse files Browse the repository at this point in the history
…ing to do it all over the place
  • Loading branch information
andreasohlund committed Sep 26, 2011
1 parent 700f598 commit ce986eb
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 17 deletions.
3 changes: 0 additions & 3 deletions src/config/NServiceBus.Config/Configure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ public static Configure With(IEnumerable<Type> typesToScan)

TypesToScan = typesToScan;

ExtensionMethods.IsMessageTypeAction =
t => typeof(IMessage).IsAssignableFrom(t) && typeof(IMessage) != t;

return instance;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/NServiceBus/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public static void CopyHeaderFromRequest(this object msg, string key)
/// <summary>
/// The function used to determine whether a type is a message type.
/// </summary>
public static Func<Type, bool> IsMessageTypeAction { get; set; }
public static Func<Type, bool> IsMessageTypeAction = t => typeof(IMessage).IsAssignableFrom(t) && typeof(IMessage) != t;


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ public class SerializerTests
private int number = 1;
private int numberOfIterations = 100;

[SetUp]
public void Setup()
{
NServiceBus.ExtensionMethods.IsMessageTypeAction = t => typeof(IMessage).IsAssignableFrom(t) && t != typeof(IMessage);
}

[Test]
public void Generic_properties_should_be_supported()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public MessageWithArray(Guid sagaId, int[] someInts)
[TestFixture]
public class SerializingArrayTests
{
[SetUp]
public void Setup()
{
NServiceBus.ExtensionMethods.IsMessageTypeAction = t => typeof (IMessage).IsAssignableFrom(t) && t != typeof(IMessage);
}

[Test]
public void CanDeserializeXmlWithWhitespace()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class TestHandlerFixture
public void TestFixtureSetUp()
{
Test.Initialize(typeof(IMessage).Assembly, typeof(TestHandlerFixture).Assembly);
ExtensionMethods.IsMessageTypeAction = t => typeof (IMessage).IsAssignableFrom(t) && t != typeof (IMessage);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public void SetUp()
{
}

ExtensionMethods.IsMessageTypeAction = t => typeof(IMessage).IsAssignableFrom(t) && t != typeof(IMessage);
ExtensionMethods.GetStaticOutgoingHeadersAction = () => MessageHeaderManager.staticHeaders;
gatewayAddress = masterNodeAddress.SubScope("gateway");

Expand Down

0 comments on commit ce986eb

Please sign in to comment.