-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
166 changed files
with
9,125 additions
and
2,133 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -13,6 +13,7 @@ _UpgradeReport.* | |
*.resharper | ||
*.suo | ||
*.cache | ||
*.sln.ide | ||
*~ | ||
*.swp | ||
*.user | ||
|
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 +1 @@ | ||
assemblyVersioningScheme: Major | ||
assembly-versioning-scheme: Major |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="GitVersionTask" version="1.3.3" targetFramework="net45" developmentDependency="true" /> | ||
<package id="GitVersionTask" version="2.0.1" targetFramework="net45" developmentDependency="true" /> | ||
<package id="NuGetPackager" version="0.4.10" targetFramework="net45" developmentDependency="true" /> | ||
</packages> |
72 changes: 72 additions & 0 deletions
72
src/NServiceBus.AcceptanceTests/Audit/When_ForwardReceivedMessagesTo_is_set.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,72 @@ | ||
namespace NServiceBus.AcceptanceTests.Audit | ||
{ | ||
using System; | ||
using EndpointTemplates; | ||
using AcceptanceTesting; | ||
using NServiceBus.Config; | ||
using NUnit.Framework; | ||
|
||
public class When_ForwardReceivedMessagesTo_is_set : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public void Should_forward_message() | ||
{ | ||
var context = new Context(); | ||
|
||
Scenario.Define(context) | ||
.WithEndpoint<EndpointThatForwards>(b => b.Given((bus, c) => | ||
{ | ||
bus.SendLocal(new MessageToForward()); | ||
})) | ||
.WithEndpoint<ForwardReceiver>() | ||
.Done(c => c.GotForwardedMessage) | ||
.Run(); | ||
|
||
Assert.IsTrue(context.GotForwardedMessage); | ||
} | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
public bool GotForwardedMessage { get; set; } | ||
} | ||
|
||
public class ForwardReceiver : EndpointConfigurationBuilder | ||
{ | ||
public ForwardReceiver() | ||
{ | ||
EndpointSetup<DefaultServer>(c => c.EndpointName("forward_receiver")); | ||
} | ||
|
||
public class MessageToForwardHandler : IHandleMessages<MessageToForward> | ||
{ | ||
public Context Context { get; set; } | ||
|
||
public void Handle(MessageToForward message) | ||
{ | ||
Context.GotForwardedMessage = true; | ||
} | ||
} | ||
} | ||
|
||
public class EndpointThatForwards : EndpointConfigurationBuilder | ||
{ | ||
public EndpointThatForwards() | ||
{ | ||
EndpointSetup<DefaultServer>() | ||
.WithConfig<UnicastBusConfig>(c => c.ForwardReceivedMessagesTo = "forward_receiver"); | ||
} | ||
|
||
public class MessageToForwardHandler : IHandleMessages<MessageToForward> | ||
{ | ||
public void Handle(MessageToForward message) | ||
{ | ||
} | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class MessageToForward : IMessage | ||
{ | ||
} | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/NServiceBus.AcceptanceTests/Basic/When_callback_from_a_send_only.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,52 @@ | ||
namespace NServiceBus.AcceptanceTests.Basic | ||
{ | ||
using System; | ||
using NServiceBus.AcceptanceTesting; | ||
using NServiceBus.AcceptanceTests.EndpointTemplates; | ||
using NUnit.Framework; | ||
|
||
public class When_callback_from_a_send_only : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public void Should_throw() | ||
{ | ||
Scenario.Define<Context>() | ||
.WithEndpoint<SendOnlyEndpoint>(b => b.Given((bus, c) => | ||
{ | ||
var exception = Assert.Throws<Exception>(() => bus.Send(new MyMessage()).Register(result => { })); | ||
Assert.AreEqual("Callbacks are invalid in a sendonly endpoint.", exception.Message); | ||
})) | ||
.WithEndpoint<Receiver>() | ||
.Run(); | ||
} | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
} | ||
|
||
public class SendOnlyEndpoint : EndpointConfigurationBuilder | ||
{ | ||
public SendOnlyEndpoint() | ||
{ | ||
EndpointSetup<DefaultServer>() | ||
.SendOnly() | ||
.AddMapping<MyMessage>(typeof(Receiver)); | ||
} | ||
|
||
} | ||
public class Receiver : EndpointConfigurationBuilder | ||
{ | ||
public Receiver() | ||
{ | ||
EndpointSetup<DefaultServer>(); | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class MyMessage : ICommand | ||
{ | ||
} | ||
|
||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
src/NServiceBus.AcceptanceTests/Basic/When_injecting_handler_props.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,67 @@ | ||
namespace NServiceBus.AcceptanceTests.Basic | ||
{ | ||
using System; | ||
using NServiceBus.AcceptanceTesting; | ||
using NServiceBus.AcceptanceTests.EndpointTemplates; | ||
using NUnit.Framework; | ||
|
||
public class When_injecting_handler_props : NServiceBusAcceptanceTest | ||
{ | ||
[Test] | ||
public void Run() | ||
{ | ||
var context = new Context(); | ||
|
||
Scenario.Define(context) | ||
.WithEndpoint<Receiver>(c=>c.When(b=>b.SendLocal(new MyMessage()))) | ||
.Done(c => c.WasCalled) | ||
.Run(); | ||
|
||
Assert.AreEqual(10, context.Number); | ||
Assert.AreEqual("Foo", context.Name); | ||
} | ||
|
||
public class Context : ScenarioContext | ||
{ | ||
public bool WasCalled { get; set; } | ||
public string Name { get; set; } | ||
public int Number { get; set; } | ||
} | ||
|
||
public class Receiver : EndpointConfigurationBuilder | ||
{ | ||
public Receiver() | ||
{ | ||
EndpointSetup<DefaultServer>(c => | ||
{ | ||
c.InitializeHandlerProperty<MyMessageHandler>("Number", 10); | ||
c.InitializeHandlerProperty<MyMessageHandler>("Name", "Foo"); | ||
}); | ||
|
||
} | ||
|
||
public class MyMessageHandler : IHandleMessages<MyMessage> | ||
{ | ||
public Context Context { get; set; } | ||
|
||
public IBus Bus { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public int Number { get; set; } | ||
|
||
public void Handle(MyMessage message) | ||
{ | ||
Context.Number = Number; | ||
Context.Name = Name; | ||
Context.WasCalled = true; | ||
} | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class MyMessage : ICommand | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.