From a17aa8770b0b4861849c6e01812b2ff686497f02 Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Sun, 4 Aug 2019 15:02:58 +0800 Subject: Add unit tests for token. --- Timeline.Tests/Helpers/ResponseExtensions.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Timeline.Tests/Helpers/ResponseExtensions.cs (limited to 'Timeline.Tests/Helpers/ResponseExtensions.cs') diff --git a/Timeline.Tests/Helpers/ResponseExtensions.cs b/Timeline.Tests/Helpers/ResponseExtensions.cs new file mode 100644 index 00000000..86ac1c88 --- /dev/null +++ b/Timeline.Tests/Helpers/ResponseExtensions.cs @@ -0,0 +1,14 @@ +using Newtonsoft.Json; +using System.Net.Http; +using System.Threading.Tasks; + +namespace Timeline.Tests.Helpers +{ + public static class ResponseExtensions + { + public static async Task ReadBodyAsJson(this HttpResponseMessage response) + { + return JsonConvert.DeserializeObject(await response.Content.ReadAsStringAsync()); + } + } +} -- cgit v1.2.3