-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5756 from Particular/remove-static-delivery-const…
…raint Remove static delivery constraint
- Loading branch information
Showing
7 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/NServiceBus.Core.Tests/Transports/MulticastTransportOperationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace NServiceBus.Core.Tests.Transports | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using Transport; | ||
|
||
[TestFixture] | ||
public class MulticastTransportOperationTest | ||
{ | ||
[Test] | ||
public void Should_not_share_constraints_when_not_provided() | ||
{ | ||
var transportOperation = new MulticastTransportOperation(new OutgoingMessage(Guid.NewGuid().ToString(), new Dictionary<string, string>(), new byte[0]), typeof(Guid)); | ||
var secondTransportOperation = new MulticastTransportOperation(new OutgoingMessage(Guid.NewGuid().ToString(), new Dictionary<string, string>(), new byte[0]), typeof(Guid)); | ||
|
||
transportOperation.DeliveryConstraints.Add(new NonDurableDelivery()); | ||
|
||
Assert.IsEmpty(secondTransportOperation.DeliveryConstraints); | ||
Assert.IsNotEmpty(transportOperation.DeliveryConstraints); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/NServiceBus.Core.Tests/Transports/TransportOperationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace NServiceBus.Core.Tests.Transports | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using NServiceBus.Routing; | ||
using NUnit.Framework; | ||
using Transport; | ||
|
||
[TestFixture] | ||
public class TransportOperationTest | ||
{ | ||
[Test] | ||
public void Should_not_share_constraints_when_not_provided() | ||
{ | ||
var transportOperation = new TransportOperation(new OutgoingMessage(Guid.NewGuid().ToString(), new Dictionary<string, string>(), new byte[0]), new UnicastAddressTag("destination")); | ||
var secondTransportOperation = new TransportOperation(new OutgoingMessage(Guid.NewGuid().ToString(), new Dictionary<string, string>(), new byte[0]), new UnicastAddressTag("destination2")); | ||
|
||
transportOperation.DeliveryConstraints.Add(new NonDurableDelivery()); | ||
|
||
Assert.IsEmpty(secondTransportOperation.DeliveryConstraints); | ||
Assert.IsNotEmpty(transportOperation.DeliveryConstraints); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/NServiceBus.Core.Tests/Transports/UnicastTransportOperationTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace NServiceBus.Core.Tests.Transports | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
using Transport; | ||
|
||
[TestFixture] | ||
public class UnicastTransportOperationTest | ||
{ | ||
[Test] | ||
public void Should_not_share_constraints_when_not_provided() | ||
{ | ||
var transportOperation = new UnicastTransportOperation(new OutgoingMessage(Guid.NewGuid().ToString(), new Dictionary<string, string>(), new byte[0]), "destination"); | ||
var secondTransportOperation = new UnicastTransportOperation(new OutgoingMessage(Guid.NewGuid().ToString(), new Dictionary<string, string>(), new byte[0]), "destination2"); | ||
|
||
transportOperation.DeliveryConstraints.Add(new NonDurableDelivery()); | ||
|
||
Assert.IsEmpty(secondTransportOperation.DeliveryConstraints); | ||
Assert.IsNotEmpty(transportOperation.DeliveryConstraints); | ||
} | ||
} | ||
} |
5 changes: 1 addition & 4 deletions
5
src/NServiceBus.Core/DeliveryConstraints/DeliveryConstraint.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
namespace NServiceBus.DeliveryConstraints | ||
{ | ||
using System.Collections.Generic; | ||
|
||
{ | ||
/// <summary> | ||
/// Base class for delivery constraints. | ||
/// </summary> | ||
public abstract class DeliveryConstraint | ||
{ | ||
internal static List<DeliveryConstraint> EmptyConstraints = new List<DeliveryConstraint>(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters