diff --git a/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs index 9dff1506d5..e12def60fa 100644 --- a/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/Google/GoogleMiddlewareTests.cs @@ -424,7 +424,7 @@ namespace Microsoft.AspNet.Security.Google private static async Task ReturnJsonResponse(object content) { var res = new HttpResponseMessage(HttpStatusCode.OK); - var text = await JsonConvert.SerializeObjectAsync(content); + var text = await Task.Factory.StartNew(() => JsonConvert.SerializeObject(content)); res.Content = new StringContent(text, Encoding.UTF8, "application/json"); return res; } diff --git a/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs index 2c1da025fd..7bfb0d4491 100644 --- a/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/MicrosoftAccount/MicrosoftAccountMiddlewareTests.cs @@ -204,7 +204,7 @@ namespace Microsoft.AspNet.Security.Tests.MicrosoftAccount private static async Task ReturnJsonResponse(object content) { var res = new HttpResponseMessage(HttpStatusCode.OK); - var text = await JsonConvert.SerializeObjectAsync(content); + var text = await Task.Factory.StartNew(() => JsonConvert.SerializeObject(content)); res.Content = new StringContent(text, Encoding.UTF8, "application/json"); return res; } diff --git a/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs b/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs index d5eb56896b..75f7ebbfd3 100644 --- a/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Security.Test/Twitter/TwitterMiddlewareTests.cs @@ -152,7 +152,7 @@ namespace Microsoft.AspNet.Security.Twitter private static async Task ReturnJsonResponse(object content) { var res = new HttpResponseMessage(HttpStatusCode.OK); - var text = await JsonConvert.SerializeObjectAsync(content); + var text = await Task.Factory.StartNew(() => JsonConvert.SerializeObject(content)); res.Content = new StringContent(text, Encoding.UTF8, "application/json"); return res; }