aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-24 20:15:58 +0800
committerGitHub <noreply@github.com>2019-10-24 20:15:58 +0800
commit4ab69665f26aaa59bad8684e6b801b4c4cf900cd (patch)
tree7ca5010a06829cc5fadea1ea17ae72d082fc344c /Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs
parent21de8da2feab19d3fbc392e71bf0dcec25ec8d6b (diff)
parent2bc4c701f9cdff1fdd11a5736c33a5818fbae3e9 (diff)
downloadtimeline-4ab69665f26aaa59bad8684e6b801b4c4cf900cd.tar.gz
timeline-4ab69665f26aaa59bad8684e6b801b4c4cf900cd.tar.bz2
timeline-4ab69665f26aaa59bad8684e6b801b4c4cf900cd.zip
Merge pull request #50 from crupest/refactor
Refactor : A Huge Step
Diffstat (limited to 'Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs')
-rw-r--r--Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs b/Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs
new file mode 100644
index 00000000..b78309c0
--- /dev/null
+++ b/Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs
@@ -0,0 +1,16 @@
+using FluentAssertions;
+using FluentAssertions.Primitives;
+using FluentAssertions.Specialized;
+using System;
+using System.Threading.Tasks;
+
+namespace Timeline.Tests.Helpers
+{
+ public static class AsyncFunctionAssertionsExtensions
+ {
+ public static async Task<AndConstraint<ObjectAssertions>> ThrowAsync(this AsyncFunctionAssertions assertions, Type exceptionType, string because = "", params object[] becauseArgs)
+ {
+ return (await assertions.ThrowAsync<Exception>(because, becauseArgs)).Which.Should().BeAssignableTo(exceptionType);
+ }
+ }
+}