-
Notifications
You must be signed in to change notification settings - Fork 3
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
7 changed files
with
98 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Castle.Config; | ||
using Castle.Infrastructure; | ||
using Castle.Infrastructure.Exceptions; | ||
using Castle.Messages; | ||
using Castle.Messages.Responses; | ||
|
||
namespace Castle.Actions | ||
{ | ||
internal static class Log | ||
{ | ||
public static async Task<VoidResponse> Execute( | ||
Func<Task<VoidResponse>> send, | ||
CastleConfiguration configuration) | ||
{ | ||
return await send(); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System.Threading.Tasks; | ||
using Castle.Actions; | ||
using Castle.Config; | ||
using Castle.Messages.Responses; | ||
using FluentAssertions; | ||
using Tests.SetUp; | ||
using Xunit; | ||
|
||
namespace Tests | ||
{ | ||
public class When_sending_log | ||
{ | ||
[Theory, AutoFakeData] | ||
public async Task Should_return_response_if_successful( | ||
CastleConfiguration configuration) | ||
{ | ||
var response = new VoidResponse(); | ||
Task<VoidResponse> Send() => Task.FromResult(response); | ||
|
||
var result = await Log.Execute(Send, configuration); | ||
|
||
result.Should().Be(response); | ||
} | ||
} | ||
} |
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