From 280faac75b113d9a4bbecd7e4ea3499f1691ce61 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Thu, 24 Oct 2019 19:57:59 +0800 Subject: ... --- .../Helpers/AsyncFunctionAssertionsExtensions.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs (limited to 'Timeline.Tests/Helpers/AsyncFunctionAssertionsExtensions.cs') 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> ThrowAsync(this AsyncFunctionAssertions assertions, Type exceptionType, string because = "", params object[] becauseArgs) + { + return (await assertions.ThrowAsync(because, becauseArgs)).Which.Should().BeAssignableTo(exceptionType); + } + } +} -- cgit v1.2.3