-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scoped and Transient lifetime added #31
- Loading branch information
1 parent
60b2ebf
commit 4d83168
Showing
8 changed files
with
131 additions
and
112 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
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 was deleted.
Oops, something went wrong.
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,31 @@ | ||
using System; | ||
using FluentMediator; | ||
using FluentMediator.Pipelines; | ||
using UnitTests.PingPong; | ||
using Xunit; | ||
|
||
namespace UnitTests | ||
{ | ||
public class BuildingMediatorTests | ||
{ | ||
[Fact] | ||
public void Build_DuplicatedRequest_ThrowsPipelineAlreadyExistsException() | ||
{ | ||
var m = new PipelinesBuilder(); | ||
|
||
m.On<PingRequest>().AsyncPipeline() | ||
.Return<PingResponse, IPingHandler>( | ||
(handler, req) => handler.MyCustomFooBarAsync(req) | ||
); | ||
m.On<PingRequest>().AsyncPipeline() | ||
.Return<PingResponse, IPingHandler>( | ||
(handler, req) => handler.MyCustomFooBarAsync(req) | ||
); | ||
|
||
var ex = Record.Exception(() => m.Build()); | ||
|
||
Assert.NotNull(ex); | ||
Assert.IsType<PipelineAlreadyExistsException>(ex); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.