From b62130ba21d14a9bb5c6931938d9062d2973d57b Mon Sep 17 00:00:00 2001 From: tr00d Date: Tue, 19 Sep 2023 09:12:09 +0200 Subject: [PATCH] Use expression-bodied methods --- Vonage.Test.Unit/TestBase.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Vonage.Test.Unit/TestBase.cs b/Vonage.Test.Unit/TestBase.cs index 032b4c03a..a7ca8305e 100644 --- a/Vonage.Test.Unit/TestBase.cs +++ b/Vonage.Test.Unit/TestBase.cs @@ -55,16 +55,12 @@ private static string AssemblyDirectory } protected void Setup(string uri, string responseContent, string requestContent = null, - HttpStatusCode expectedCode = HttpStatusCode.OK) - { + HttpStatusCode expectedCode = HttpStatusCode.OK) => this.Setup(uri, new StringContent(responseContent, Encoding.UTF8, "application/json"), expectedCode, requestContent); - } - protected void Setup(string uri, byte[] responseContent, HttpStatusCode expectedCode = HttpStatusCode.OK) - { + protected void Setup(string uri, byte[] responseContent, HttpStatusCode expectedCode = HttpStatusCode.OK) => this.Setup(uri, new StreamContent(new MemoryStream(responseContent)), expectedCode); - } private void Setup(string uri, HttpContent httpContent, HttpStatusCode expectedCode, string requestContent = null) @@ -116,12 +112,8 @@ protected string GetResponseJson([CallerMemberName] string name = null) return string.Empty; } - protected string GetResponseJson(Dictionary parameters, [CallerMemberName] string name = null) - { - var response = this.GetResponseJson(name); - response = TokenReplacementRegEx.Replace(response, match => parameters[match.Groups[1].Value]); - return response; - } + protected string GetResponseJson(Dictionary parameters, [CallerMemberName] string name = null) => + TokenReplacementRegEx.Replace(this.GetResponseJson(name), match => parameters[match.Groups[1].Value]); protected string GetRequestJson([CallerMemberName] string name = null) {