From a8f7e88f26056aedb113eaaae7da8df364b91db8 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Fri, 14 Sep 2018 10:20:51 -0300 Subject: [PATCH] Updating CFP to 2.1.0 --- .../WebJobs.Extensions.CosmosDB.csproj | 2 +- .../CosmosDBTestUtility.cs | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/WebJobs.Extensions.CosmosDB/WebJobs.Extensions.CosmosDB.csproj b/src/WebJobs.Extensions.CosmosDB/WebJobs.Extensions.CosmosDB.csproj index bd1532d7c..57b02a23d 100644 --- a/src/WebJobs.Extensions.CosmosDB/WebJobs.Extensions.CosmosDB.csproj +++ b/src/WebJobs.Extensions.CosmosDB/WebJobs.Extensions.CosmosDB.csproj @@ -9,7 +9,7 @@ This package contains binding extensions for Azure Cosmos DB. - + diff --git a/test/WebJobs.Extensions.CosmosDB.Tests/CosmosDBTestUtility.cs b/test/WebJobs.Extensions.CosmosDB.Tests/CosmosDBTestUtility.cs index 7ddfe52ae..211f56fac 100644 --- a/test/WebJobs.Extensions.CosmosDB.Tests/CosmosDBTestUtility.cs +++ b/test/WebJobs.Extensions.CosmosDB.Tests/CosmosDBTestUtility.cs @@ -81,9 +81,14 @@ public static IOrderedQueryable AsOrderedQueryable(this IEnumerable< public static DocumentClientException CreateDocumentClientException(HttpStatusCode status) { - var headers = new NameValueCollection(); - var parameters = new object[] { null, null, headers, status, null }; - return Activator.CreateInstance(typeof(DocumentClientException), BindingFlags.NonPublic | BindingFlags.Instance, null, parameters, null) as DocumentClientException; + Type t = typeof(DocumentClientException); + + var constructor = t.GetConstructor( + BindingFlags.Public | BindingFlags.Instance | BindingFlags.NonPublic, + null, new[] { typeof(string), typeof(Exception), typeof(HttpStatusCode?), typeof(Uri), typeof(string) }, null); + + object ex = constructor.Invoke(new object[] { string.Empty, new Exception(), status, null, string.Empty }); + return ex as DocumentClientException; } public static ParameterInfo GetInputParameter()