You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New HttpMessageOptions class and AppVeyor changes.
- New HttpMessageOptions class so we can now also test for the HttpMethod (GET/POST, etc).
- Updated the AppVeyor settings to be more automated and helpful.
$"No HttpResponseMessage found for the Request Uri: {requestUrl}. Please provide one in the FakeHttpMessageHandler constructor Or use a '*' for any request uri. Search-Key: '{requestUrl}. Setup: 1 responses: DELETE {requestUrl}");
@@ -32,20 +33,50 @@ public FakeHttpMessageHandler(string requestUri, HttpResponseMessage httpRespons
32
33
/// A fake message handler.
33
34
/// </summary>
34
35
/// <remarks>TIP: If you have a requestUri = "*", this is a catch-all ... so if none of the other requestUri's match, then it will fall back to this dictionary item.</remarks>
35
-
/// <param name="httpResponseMessages">A dictionary of request endpoints and their respective fake response message.</param>
@@ -54,9 +85,9 @@ public FakeHttpMessageHandler(IDictionary<string, HttpResponseMessage> httpRespo
54
85
/// <remarks>This constructor doesn't care what the request endpoint it. So if you're code is trying to hit multuple endpoints, then it will always return the same response message.</remarks>
// Nope - no keys found exactly OR starting-with...
117
152
118
-
varresponsesText=_responses==null
153
+
varresponsesText=!_lotsOfOptions.Any()
119
154
?"-none-"
120
-
:string.Join(";",_responses.Keys);
155
+
:string.Join(";",_lotsOfOptions.Values);
121
156
122
157
varerrorMessage=
123
158
string.Format(
124
159
"No HttpResponseMessage found for the Request Uri: {0}. Please provide one in the FakeHttpMessageHandler constructor Or use a '*' for any request uri. Search-Key: '{1}. Setup: {2} responses: {3}",
125
160
request.RequestUri,
126
161
requestUri,
127
-
_responses==null
162
+
!_lotsOfOptions.Any()
128
163
?"- no responses -"
129
-
:_responses.Count.ToString(),
164
+
:_lotsOfOptions.Count.ToString(),
130
165
responsesText);
131
166
thrownewInvalidOperationException(errorMessage);
132
167
}
133
168
}
134
169
135
-
tcs.SetResult(response);
170
+
tcs.SetResult(options.HttpResponseMessage);
136
171
returntcs.Task;
137
172
}
138
173
@@ -149,5 +184,30 @@ public static HttpResponseMessage GetStringHttpResponseMessage(string content,
0 commit comments