0
|
1 <?xml version="1.0"?>
|
|
2 <doc>
|
|
3 <assembly>
|
|
4 <name>Moq</name>
|
|
5 </assembly>
|
|
6 <members>
|
|
7 <member name="T:Moq.Language.ISetupConditionResult`1">
|
|
8 <summary>
|
|
9 Implements the fluent API.
|
|
10 </summary>
|
|
11 </member>
|
|
12 <member name="M:Moq.Language.ISetupConditionResult`1.Setup(System.Linq.Expressions.Expression{System.Action{`0}})">
|
|
13 <summary>
|
|
14 The expectation will be considered only in the former condition.
|
|
15 </summary>
|
|
16 <param name="expression"></param>
|
|
17 <returns></returns>
|
|
18 </member>
|
|
19 <member name="M:Moq.Language.ISetupConditionResult`1.Setup``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
20 <summary>
|
|
21 The expectation will be considered only in the former condition.
|
|
22 </summary>
|
|
23 <typeparam name="TResult"></typeparam>
|
|
24 <param name="expression"></param>
|
|
25 <returns></returns>
|
|
26 </member>
|
|
27 <member name="M:Moq.Language.ISetupConditionResult`1.SetupGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
28 <summary>
|
|
29 Setups the get.
|
|
30 </summary>
|
|
31 <typeparam name="TProperty">The type of the property.</typeparam>
|
|
32 <param name="expression">The expression.</param>
|
|
33 <returns></returns>
|
|
34 </member>
|
|
35 <member name="M:Moq.Language.ISetupConditionResult`1.SetupSet``1(System.Action{`0})">
|
|
36 <summary>
|
|
37 Setups the set.
|
|
38 </summary>
|
|
39 <typeparam name="TProperty">The type of the property.</typeparam>
|
|
40 <param name="setterExpression">The setter expression.</param>
|
|
41 <returns></returns>
|
|
42 </member>
|
|
43 <member name="M:Moq.Language.ISetupConditionResult`1.SetupSet(System.Action{`0})">
|
|
44 <summary>
|
|
45 Setups the set.
|
|
46 </summary>
|
|
47 <param name="setterExpression">The setter expression.</param>
|
|
48 <returns></returns>
|
|
49 </member>
|
|
50 <member name="M:Moq.IInterceptStrategy.HandleIntercept(Moq.Proxy.ICallContext,Moq.InterceptStrategyContext)">
|
|
51 <summary>
|
|
52 Handle interception
|
|
53 </summary>
|
|
54 <param name="invocation">the current invocation context</param>
|
|
55 <param name="ctx">shared data among the strategies during an interception</param>
|
|
56 <returns>true if further interception has to be processed, otherwise false</returns>
|
|
57 </member>
|
|
58 <member name="T:Moq.IMock`1">
|
|
59 <summary>
|
|
60 Covarient interface for Mock<T> such that casts between IMock<Employee> to IMock<Person>
|
|
61 are possible. Only covers the covariant members of Mock<T>.
|
|
62 </summary>
|
|
63 </member>
|
|
64 <member name="P:Moq.IMock`1.Object">
|
|
65 <summary>
|
|
66 Exposes the mocked object instance.
|
|
67 </summary>
|
|
68 </member>
|
|
69 <member name="P:Moq.IMock`1.Behavior">
|
|
70 <summary>
|
|
71 Behavior of the mock, according to the value set in the constructor.
|
|
72 </summary>
|
|
73 </member>
|
|
74 <member name="P:Moq.IMock`1.CallBase">
|
|
75 <summary>
|
|
76 Whether the base member virtual implementation will be called
|
|
77 for mocked classes if no setup is matched. Defaults to <see langword="false"/>.
|
|
78 </summary>
|
|
79 </member>
|
|
80 <member name="P:Moq.IMock`1.DefaultValue">
|
|
81 <summary>
|
|
82 Specifies the behavior to use when returning default values for
|
|
83 unexpected invocations on loose mocks.
|
|
84 </summary>
|
|
85 </member>
|
|
86 <member name="M:Moq.AddActualInvocation.GetEventFromName(System.String)">
|
|
87 <summary>
|
|
88 Get an eventInfo for a given event name. Search type ancestors depth first if necessary.
|
|
89 </summary>
|
|
90 <param name="eventName">Name of the event, with the set_ or get_ prefix already removed</param>
|
|
91 </member>
|
|
92 <member name="M:Moq.AddActualInvocation.GetNonPublicEventFromName(System.String)">
|
|
93 <summary>
|
|
94 Get an eventInfo for a given event name. Search type ancestors depth first if necessary.
|
|
95 Searches also in non public events.
|
|
96 </summary>
|
|
97 <param name="eventName">Name of the event, with the set_ or get_ prefix already removed</param>
|
|
98 </member>
|
|
99 <member name="M:Moq.AddActualInvocation.GetAncestorTypes(System.Type)">
|
|
100 <summary>
|
|
101 Given a type return all of its ancestors, both types and interfaces.
|
|
102 </summary>
|
|
103 <param name="initialType">The type to find immediate ancestors of</param>
|
|
104 </member>
|
|
105 <member name="T:Moq.Language.ICallback">
|
|
106 <summary>
|
|
107 Defines the <c>Callback</c> verb and overloads.
|
|
108 </summary>
|
|
109 </member>
|
|
110 <member name="T:Moq.IHideObjectMembers">
|
|
111 <summary>
|
|
112 Helper interface used to hide the base <see cref="T:System.Object"/>
|
|
113 members from the fluent API to make it much cleaner
|
|
114 in Visual Studio intellisense.
|
|
115 </summary>
|
|
116 </member>
|
|
117 <member name="M:Moq.IHideObjectMembers.GetType">
|
|
118 <summary/>
|
|
119 </member>
|
|
120 <member name="M:Moq.IHideObjectMembers.GetHashCode">
|
|
121 <summary/>
|
|
122 </member>
|
|
123 <member name="M:Moq.IHideObjectMembers.ToString">
|
|
124 <summary/>
|
|
125 </member>
|
|
126 <member name="M:Moq.IHideObjectMembers.Equals(System.Object)">
|
|
127 <summary/>
|
|
128 </member>
|
|
129 <member name="M:Moq.Language.ICallback.Callback(System.Action)">
|
|
130 <summary>
|
|
131 Specifies a callback to invoke when the method is called.
|
|
132 </summary>
|
|
133 <param name="action">The callback method to invoke.</param>
|
|
134 <example>
|
|
135 The following example specifies a callback to set a boolean
|
|
136 value that can be used later:
|
|
137 <code>
|
|
138 var called = false;
|
|
139 mock.Setup(x => x.Execute())
|
|
140 .Callback(() => called = true);
|
|
141 </code>
|
|
142 </example>
|
|
143 </member>
|
|
144 <member name="M:Moq.Language.ICallback.Callback``1(System.Action{``0})">
|
|
145 <summary>
|
|
146 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
147 </summary>
|
|
148 <typeparam name="T">The argument type of the invoked method.</typeparam>
|
|
149 <param name="action">The callback method to invoke.</param>
|
|
150 <example>
|
|
151 Invokes the given callback with the concrete invocation argument value.
|
|
152 <para>
|
|
153 Notice how the specific string argument is retrieved by simply declaring
|
|
154 it as part of the lambda expression for the callback:
|
|
155 </para>
|
|
156 <code>
|
|
157 mock.Setup(x => x.Execute(It.IsAny<string>()))
|
|
158 .Callback((string command) => Console.WriteLine(command));
|
|
159 </code>
|
|
160 </example>
|
|
161 </member>
|
|
162 <member name="M:Moq.Language.ICallback.Callback``2(System.Action{``0,``1})">
|
|
163 <summary>
|
|
164 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
165 </summary>
|
|
166 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
167 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
168 <param name="action">The callback method to invoke.</param>
|
|
169 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
170 <example>
|
|
171 Invokes the given callback with the concrete invocation arguments values.
|
|
172 <para>
|
|
173 Notice how the specific arguments are retrieved by simply declaring
|
|
174 them as part of the lambda expression for the callback:
|
|
175 </para>
|
|
176 <code>
|
|
177 mock.Setup(x => x.Execute(
|
|
178 It.IsAny<string>(),
|
|
179 It.IsAny<string>()))
|
|
180 .Callback((string arg1, string arg2) => Console.WriteLine(arg1 + arg2));
|
|
181 </code>
|
|
182 </example>
|
|
183 </member>
|
|
184 <member name="M:Moq.Language.ICallback.Callback``3(System.Action{``0,``1,``2})">
|
|
185 <summary>
|
|
186 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
187 </summary>
|
|
188 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
189 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
190 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
191 <param name="action">The callback method to invoke.</param>
|
|
192 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
193 <example>
|
|
194 Invokes the given callback with the concrete invocation arguments values.
|
|
195 <para>
|
|
196 Notice how the specific arguments are retrieved by simply declaring
|
|
197 them as part of the lambda expression for the callback:
|
|
198 </para>
|
|
199 <code>
|
|
200 mock.Setup(x => x.Execute(
|
|
201 It.IsAny<string>(),
|
|
202 It.IsAny<string>(),
|
|
203 It.IsAny<string>()))
|
|
204 .Callback((string arg1, string arg2, string arg3) => Console.WriteLine(arg1 + arg2 + arg3));
|
|
205 </code>
|
|
206 </example>
|
|
207 </member>
|
|
208 <member name="M:Moq.Language.ICallback.Callback``4(System.Action{``0,``1,``2,``3})">
|
|
209 <summary>
|
|
210 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
211 </summary>
|
|
212 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
213 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
214 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
215 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
216 <param name="action">The callback method to invoke.</param>
|
|
217 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
218 <example>
|
|
219 Invokes the given callback with the concrete invocation arguments values.
|
|
220 <para>
|
|
221 Notice how the specific arguments are retrieved by simply declaring
|
|
222 them as part of the lambda expression for the callback:
|
|
223 </para>
|
|
224 <code>
|
|
225 mock.Setup(x => x.Execute(
|
|
226 It.IsAny<string>(),
|
|
227 It.IsAny<string>(),
|
|
228 It.IsAny<string>(),
|
|
229 It.IsAny<string>()))
|
|
230 .Callback((string arg1, string arg2, string arg3, string arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
|
|
231 </code>
|
|
232 </example>
|
|
233 </member>
|
|
234 <member name="M:Moq.Language.ICallback.Callback``5(System.Action{``0,``1,``2,``3,``4})">
|
|
235 <summary>
|
|
236 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
237 </summary>
|
|
238 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
239 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
240 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
241 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
242 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
243 <param name="action">The callback method to invoke.</param>
|
|
244 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
245 <example>
|
|
246 Invokes the given callback with the concrete invocation arguments values.
|
|
247 <para>
|
|
248 Notice how the specific arguments are retrieved by simply declaring
|
|
249 them as part of the lambda expression for the callback:
|
|
250 </para>
|
|
251 <code>
|
|
252 mock.Setup(x => x.Execute(
|
|
253 It.IsAny<string>(),
|
|
254 It.IsAny<string>(),
|
|
255 It.IsAny<string>(),
|
|
256 It.IsAny<string>(),
|
|
257 It.IsAny<string>()))
|
|
258 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
|
|
259 </code>
|
|
260 </example>
|
|
261 </member>
|
|
262 <member name="M:Moq.Language.ICallback.Callback``6(System.Action{``0,``1,``2,``3,``4,``5})">
|
|
263 <summary>
|
|
264 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
265 </summary>
|
|
266 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
267 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
268 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
269 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
270 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
271 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
272 <param name="action">The callback method to invoke.</param>
|
|
273 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
274 <example>
|
|
275 Invokes the given callback with the concrete invocation arguments values.
|
|
276 <para>
|
|
277 Notice how the specific arguments are retrieved by simply declaring
|
|
278 them as part of the lambda expression for the callback:
|
|
279 </para>
|
|
280 <code>
|
|
281 mock.Setup(x => x.Execute(
|
|
282 It.IsAny<string>(),
|
|
283 It.IsAny<string>(),
|
|
284 It.IsAny<string>(),
|
|
285 It.IsAny<string>(),
|
|
286 It.IsAny<string>(),
|
|
287 It.IsAny<string>()))
|
|
288 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
|
|
289 </code>
|
|
290 </example>
|
|
291 </member>
|
|
292 <member name="M:Moq.Language.ICallback.Callback``7(System.Action{``0,``1,``2,``3,``4,``5,``6})">
|
|
293 <summary>
|
|
294 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
295 </summary>
|
|
296 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
297 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
298 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
299 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
300 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
301 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
302 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
303 <param name="action">The callback method to invoke.</param>
|
|
304 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
305 <example>
|
|
306 Invokes the given callback with the concrete invocation arguments values.
|
|
307 <para>
|
|
308 Notice how the specific arguments are retrieved by simply declaring
|
|
309 them as part of the lambda expression for the callback:
|
|
310 </para>
|
|
311 <code>
|
|
312 mock.Setup(x => x.Execute(
|
|
313 It.IsAny<string>(),
|
|
314 It.IsAny<string>(),
|
|
315 It.IsAny<string>(),
|
|
316 It.IsAny<string>(),
|
|
317 It.IsAny<string>(),
|
|
318 It.IsAny<string>(),
|
|
319 It.IsAny<string>()))
|
|
320 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
|
|
321 </code>
|
|
322 </example>
|
|
323 </member>
|
|
324 <member name="M:Moq.Language.ICallback.Callback``8(System.Action{``0,``1,``2,``3,``4,``5,``6,``7})">
|
|
325 <summary>
|
|
326 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
327 </summary>
|
|
328 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
329 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
330 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
331 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
332 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
333 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
334 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
335 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
336 <param name="action">The callback method to invoke.</param>
|
|
337 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
338 <example>
|
|
339 Invokes the given callback with the concrete invocation arguments values.
|
|
340 <para>
|
|
341 Notice how the specific arguments are retrieved by simply declaring
|
|
342 them as part of the lambda expression for the callback:
|
|
343 </para>
|
|
344 <code>
|
|
345 mock.Setup(x => x.Execute(
|
|
346 It.IsAny<string>(),
|
|
347 It.IsAny<string>(),
|
|
348 It.IsAny<string>(),
|
|
349 It.IsAny<string>(),
|
|
350 It.IsAny<string>(),
|
|
351 It.IsAny<string>(),
|
|
352 It.IsAny<string>(),
|
|
353 It.IsAny<string>()))
|
|
354 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
|
|
355 </code>
|
|
356 </example>
|
|
357 </member>
|
|
358 <member name="M:Moq.Language.ICallback.Callback``9(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8})">
|
|
359 <summary>
|
|
360 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
361 </summary>
|
|
362 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
363 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
364 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
365 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
366 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
367 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
368 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
369 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
370 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
371 <param name="action">The callback method to invoke.</param>
|
|
372 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
373 <example>
|
|
374 Invokes the given callback with the concrete invocation arguments values.
|
|
375 <para>
|
|
376 Notice how the specific arguments are retrieved by simply declaring
|
|
377 them as part of the lambda expression for the callback:
|
|
378 </para>
|
|
379 <code>
|
|
380 mock.Setup(x => x.Execute(
|
|
381 It.IsAny<string>(),
|
|
382 It.IsAny<string>(),
|
|
383 It.IsAny<string>(),
|
|
384 It.IsAny<string>(),
|
|
385 It.IsAny<string>(),
|
|
386 It.IsAny<string>(),
|
|
387 It.IsAny<string>(),
|
|
388 It.IsAny<string>(),
|
|
389 It.IsAny<string>()))
|
|
390 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
|
|
391 </code>
|
|
392 </example>
|
|
393 </member>
|
|
394 <member name="M:Moq.Language.ICallback.Callback``10(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9})">
|
|
395 <summary>
|
|
396 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
397 </summary>
|
|
398 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
399 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
400 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
401 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
402 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
403 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
404 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
405 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
406 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
407 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
408 <param name="action">The callback method to invoke.</param>
|
|
409 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
410 <example>
|
|
411 Invokes the given callback with the concrete invocation arguments values.
|
|
412 <para>
|
|
413 Notice how the specific arguments are retrieved by simply declaring
|
|
414 them as part of the lambda expression for the callback:
|
|
415 </para>
|
|
416 <code>
|
|
417 mock.Setup(x => x.Execute(
|
|
418 It.IsAny<string>(),
|
|
419 It.IsAny<string>(),
|
|
420 It.IsAny<string>(),
|
|
421 It.IsAny<string>(),
|
|
422 It.IsAny<string>(),
|
|
423 It.IsAny<string>(),
|
|
424 It.IsAny<string>(),
|
|
425 It.IsAny<string>(),
|
|
426 It.IsAny<string>(),
|
|
427 It.IsAny<string>()))
|
|
428 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
|
|
429 </code>
|
|
430 </example>
|
|
431 </member>
|
|
432 <member name="M:Moq.Language.ICallback.Callback``11(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10})">
|
|
433 <summary>
|
|
434 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
435 </summary>
|
|
436 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
437 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
438 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
439 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
440 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
441 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
442 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
443 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
444 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
445 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
446 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
447 <param name="action">The callback method to invoke.</param>
|
|
448 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
449 <example>
|
|
450 Invokes the given callback with the concrete invocation arguments values.
|
|
451 <para>
|
|
452 Notice how the specific arguments are retrieved by simply declaring
|
|
453 them as part of the lambda expression for the callback:
|
|
454 </para>
|
|
455 <code>
|
|
456 mock.Setup(x => x.Execute(
|
|
457 It.IsAny<string>(),
|
|
458 It.IsAny<string>(),
|
|
459 It.IsAny<string>(),
|
|
460 It.IsAny<string>(),
|
|
461 It.IsAny<string>(),
|
|
462 It.IsAny<string>(),
|
|
463 It.IsAny<string>(),
|
|
464 It.IsAny<string>(),
|
|
465 It.IsAny<string>(),
|
|
466 It.IsAny<string>(),
|
|
467 It.IsAny<string>()))
|
|
468 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
|
|
469 </code>
|
|
470 </example>
|
|
471 </member>
|
|
472 <member name="M:Moq.Language.ICallback.Callback``12(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11})">
|
|
473 <summary>
|
|
474 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
475 </summary>
|
|
476 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
477 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
478 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
479 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
480 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
481 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
482 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
483 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
484 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
485 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
486 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
487 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
488 <param name="action">The callback method to invoke.</param>
|
|
489 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
490 <example>
|
|
491 Invokes the given callback with the concrete invocation arguments values.
|
|
492 <para>
|
|
493 Notice how the specific arguments are retrieved by simply declaring
|
|
494 them as part of the lambda expression for the callback:
|
|
495 </para>
|
|
496 <code>
|
|
497 mock.Setup(x => x.Execute(
|
|
498 It.IsAny<string>(),
|
|
499 It.IsAny<string>(),
|
|
500 It.IsAny<string>(),
|
|
501 It.IsAny<string>(),
|
|
502 It.IsAny<string>(),
|
|
503 It.IsAny<string>(),
|
|
504 It.IsAny<string>(),
|
|
505 It.IsAny<string>(),
|
|
506 It.IsAny<string>(),
|
|
507 It.IsAny<string>(),
|
|
508 It.IsAny<string>(),
|
|
509 It.IsAny<string>()))
|
|
510 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
|
|
511 </code>
|
|
512 </example>
|
|
513 </member>
|
|
514 <member name="M:Moq.Language.ICallback.Callback``13(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12})">
|
|
515 <summary>
|
|
516 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
517 </summary>
|
|
518 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
519 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
520 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
521 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
522 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
523 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
524 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
525 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
526 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
527 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
528 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
529 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
530 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
531 <param name="action">The callback method to invoke.</param>
|
|
532 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
533 <example>
|
|
534 Invokes the given callback with the concrete invocation arguments values.
|
|
535 <para>
|
|
536 Notice how the specific arguments are retrieved by simply declaring
|
|
537 them as part of the lambda expression for the callback:
|
|
538 </para>
|
|
539 <code>
|
|
540 mock.Setup(x => x.Execute(
|
|
541 It.IsAny<string>(),
|
|
542 It.IsAny<string>(),
|
|
543 It.IsAny<string>(),
|
|
544 It.IsAny<string>(),
|
|
545 It.IsAny<string>(),
|
|
546 It.IsAny<string>(),
|
|
547 It.IsAny<string>(),
|
|
548 It.IsAny<string>(),
|
|
549 It.IsAny<string>(),
|
|
550 It.IsAny<string>(),
|
|
551 It.IsAny<string>(),
|
|
552 It.IsAny<string>(),
|
|
553 It.IsAny<string>()))
|
|
554 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
|
|
555 </code>
|
|
556 </example>
|
|
557 </member>
|
|
558 <member name="M:Moq.Language.ICallback.Callback``14(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13})">
|
|
559 <summary>
|
|
560 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
561 </summary>
|
|
562 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
563 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
564 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
565 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
566 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
567 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
568 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
569 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
570 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
571 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
572 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
573 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
574 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
575 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
576 <param name="action">The callback method to invoke.</param>
|
|
577 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
578 <example>
|
|
579 Invokes the given callback with the concrete invocation arguments values.
|
|
580 <para>
|
|
581 Notice how the specific arguments are retrieved by simply declaring
|
|
582 them as part of the lambda expression for the callback:
|
|
583 </para>
|
|
584 <code>
|
|
585 mock.Setup(x => x.Execute(
|
|
586 It.IsAny<string>(),
|
|
587 It.IsAny<string>(),
|
|
588 It.IsAny<string>(),
|
|
589 It.IsAny<string>(),
|
|
590 It.IsAny<string>(),
|
|
591 It.IsAny<string>(),
|
|
592 It.IsAny<string>(),
|
|
593 It.IsAny<string>(),
|
|
594 It.IsAny<string>(),
|
|
595 It.IsAny<string>(),
|
|
596 It.IsAny<string>(),
|
|
597 It.IsAny<string>(),
|
|
598 It.IsAny<string>(),
|
|
599 It.IsAny<string>()))
|
|
600 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
|
|
601 </code>
|
|
602 </example>
|
|
603 </member>
|
|
604 <member name="M:Moq.Language.ICallback.Callback``15(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14})">
|
|
605 <summary>
|
|
606 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
607 </summary>
|
|
608 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
609 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
610 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
611 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
612 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
613 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
614 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
615 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
616 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
617 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
618 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
619 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
620 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
621 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
622 <typeparam name="T15">The type of the fifteenth argument of the invoked method.</typeparam>
|
|
623 <param name="action">The callback method to invoke.</param>
|
|
624 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
625 <example>
|
|
626 Invokes the given callback with the concrete invocation arguments values.
|
|
627 <para>
|
|
628 Notice how the specific arguments are retrieved by simply declaring
|
|
629 them as part of the lambda expression for the callback:
|
|
630 </para>
|
|
631 <code>
|
|
632 mock.Setup(x => x.Execute(
|
|
633 It.IsAny<string>(),
|
|
634 It.IsAny<string>(),
|
|
635 It.IsAny<string>(),
|
|
636 It.IsAny<string>(),
|
|
637 It.IsAny<string>(),
|
|
638 It.IsAny<string>(),
|
|
639 It.IsAny<string>(),
|
|
640 It.IsAny<string>(),
|
|
641 It.IsAny<string>(),
|
|
642 It.IsAny<string>(),
|
|
643 It.IsAny<string>(),
|
|
644 It.IsAny<string>(),
|
|
645 It.IsAny<string>(),
|
|
646 It.IsAny<string>(),
|
|
647 It.IsAny<string>()))
|
|
648 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
|
|
649 </code>
|
|
650 </example>
|
|
651 </member>
|
|
652 <member name="M:Moq.Language.ICallback.Callback``16(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14,``15})">
|
|
653 <summary>
|
|
654 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
655 </summary>
|
|
656 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
657 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
658 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
659 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
660 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
661 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
662 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
663 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
664 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
665 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
666 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
667 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
668 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
669 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
670 <typeparam name="T15">The type of the fifteenth argument of the invoked method.</typeparam>
|
|
671 <typeparam name="T16">The type of the sixteenth argument of the invoked method.</typeparam>
|
|
672 <param name="action">The callback method to invoke.</param>
|
|
673 <returns>A reference to <see cref="T:Moq.Language.Flow.ICallbackResult"/> interface.</returns>
|
|
674 <example>
|
|
675 Invokes the given callback with the concrete invocation arguments values.
|
|
676 <para>
|
|
677 Notice how the specific arguments are retrieved by simply declaring
|
|
678 them as part of the lambda expression for the callback:
|
|
679 </para>
|
|
680 <code>
|
|
681 mock.Setup(x => x.Execute(
|
|
682 It.IsAny<string>(),
|
|
683 It.IsAny<string>(),
|
|
684 It.IsAny<string>(),
|
|
685 It.IsAny<string>(),
|
|
686 It.IsAny<string>(),
|
|
687 It.IsAny<string>(),
|
|
688 It.IsAny<string>(),
|
|
689 It.IsAny<string>(),
|
|
690 It.IsAny<string>(),
|
|
691 It.IsAny<string>(),
|
|
692 It.IsAny<string>(),
|
|
693 It.IsAny<string>(),
|
|
694 It.IsAny<string>(),
|
|
695 It.IsAny<string>(),
|
|
696 It.IsAny<string>(),
|
|
697 It.IsAny<string>()))
|
|
698 .Callback((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
|
|
699 </code>
|
|
700 </example>
|
|
701 </member>
|
|
702 <member name="T:Moq.Language.ICallback`2">
|
|
703 <summary>
|
|
704 Defines the <c>Callback</c> verb and overloads for callbacks on
|
|
705 setups that return a value.
|
|
706 </summary>
|
|
707 <typeparam name="TMock">Mocked type.</typeparam>
|
|
708 <typeparam name="TResult">Type of the return value of the setup.</typeparam>
|
|
709 </member>
|
|
710 <member name="M:Moq.Language.ICallback`2.Callback(System.Action)">
|
|
711 <summary>
|
|
712 Specifies a callback to invoke when the method is called.
|
|
713 </summary>
|
|
714 <param name="action">The callback method to invoke.</param>
|
|
715 <example>
|
|
716 The following example specifies a callback to set a boolean value that can be used later:
|
|
717 <code>
|
|
718 var called = false;
|
|
719 mock.Setup(x => x.Execute())
|
|
720 .Callback(() => called = true)
|
|
721 .Returns(true);
|
|
722 </code>
|
|
723 Note that in the case of value-returning methods, after the <c>Callback</c>
|
|
724 call you can still specify the return value.
|
|
725 </example>
|
|
726 </member>
|
|
727 <member name="M:Moq.Language.ICallback`2.Callback``1(System.Action{``0})">
|
|
728 <summary>
|
|
729 Specifies a callback to invoke when the method is called that receives the original arguments.
|
|
730 </summary>
|
|
731 <typeparam name="T">The type of the argument of the invoked method.</typeparam>
|
|
732 <param name="action">Callback method to invoke.</param>
|
|
733 <example>
|
|
734 Invokes the given callback with the concrete invocation argument value.
|
|
735 <para>
|
|
736 Notice how the specific string argument is retrieved by simply declaring
|
|
737 it as part of the lambda expression for the callback:
|
|
738 </para>
|
|
739 <code>
|
|
740 mock.Setup(x => x.Execute(It.IsAny<string>()))
|
|
741 .Callback(command => Console.WriteLine(command))
|
|
742 .Returns(true);
|
|
743 </code>
|
|
744 </example>
|
|
745 </member>
|
|
746 <member name="M:Moq.Language.ICallback`2.Callback``2(System.Action{``0,``1})">
|
|
747 <summary>
|
|
748 Specifies a callback to invoke when the method is called that receives the original
|
|
749 arguments.
|
|
750 </summary>
|
|
751 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
752 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
753 <param name="action">The callback method to invoke.</param>
|
|
754 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
755 <example>
|
|
756 Invokes the given callback with the concrete invocation arguments values.
|
|
757 <para>
|
|
758 Notice how the specific arguments are retrieved by simply declaring
|
|
759 them as part of the lambda expression for the callback:
|
|
760 </para>
|
|
761 <code>
|
|
762 mock.Setup(x => x.Execute(
|
|
763 It.IsAny<string>(),
|
|
764 It.IsAny<string>()))
|
|
765 .Callback((arg1, arg2) => Console.WriteLine(arg1 + arg2));
|
|
766 </code>
|
|
767 </example>
|
|
768 </member>
|
|
769 <member name="M:Moq.Language.ICallback`2.Callback``3(System.Action{``0,``1,``2})">
|
|
770 <summary>
|
|
771 Specifies a callback to invoke when the method is called that receives the original
|
|
772 arguments.
|
|
773 </summary>
|
|
774 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
775 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
776 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
777 <param name="action">The callback method to invoke.</param>
|
|
778 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
779 <example>
|
|
780 Invokes the given callback with the concrete invocation arguments values.
|
|
781 <para>
|
|
782 Notice how the specific arguments are retrieved by simply declaring
|
|
783 them as part of the lambda expression for the callback:
|
|
784 </para>
|
|
785 <code>
|
|
786 mock.Setup(x => x.Execute(
|
|
787 It.IsAny<string>(),
|
|
788 It.IsAny<string>(),
|
|
789 It.IsAny<string>()))
|
|
790 .Callback((arg1, arg2, arg3) => Console.WriteLine(arg1 + arg2 + arg3));
|
|
791 </code>
|
|
792 </example>
|
|
793 </member>
|
|
794 <member name="M:Moq.Language.ICallback`2.Callback``4(System.Action{``0,``1,``2,``3})">
|
|
795 <summary>
|
|
796 Specifies a callback to invoke when the method is called that receives the original
|
|
797 arguments.
|
|
798 </summary>
|
|
799 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
800 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
801 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
802 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
803 <param name="action">The callback method to invoke.</param>
|
|
804 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
805 <example>
|
|
806 Invokes the given callback with the concrete invocation arguments values.
|
|
807 <para>
|
|
808 Notice how the specific arguments are retrieved by simply declaring
|
|
809 them as part of the lambda expression for the callback:
|
|
810 </para>
|
|
811 <code>
|
|
812 mock.Setup(x => x.Execute(
|
|
813 It.IsAny<string>(),
|
|
814 It.IsAny<string>(),
|
|
815 It.IsAny<string>(),
|
|
816 It.IsAny<string>()))
|
|
817 .Callback((arg1, arg2, arg3, arg4) => Console.WriteLine(arg1 + arg2 + arg3 + arg4));
|
|
818 </code>
|
|
819 </example>
|
|
820 </member>
|
|
821 <member name="M:Moq.Language.ICallback`2.Callback``5(System.Action{``0,``1,``2,``3,``4})">
|
|
822 <summary>
|
|
823 Specifies a callback to invoke when the method is called that receives the original
|
|
824 arguments.
|
|
825 </summary>
|
|
826 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
827 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
828 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
829 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
830 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
831 <param name="action">The callback method to invoke.</param>
|
|
832 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
833 <example>
|
|
834 Invokes the given callback with the concrete invocation arguments values.
|
|
835 <para>
|
|
836 Notice how the specific arguments are retrieved by simply declaring
|
|
837 them as part of the lambda expression for the callback:
|
|
838 </para>
|
|
839 <code>
|
|
840 mock.Setup(x => x.Execute(
|
|
841 It.IsAny<string>(),
|
|
842 It.IsAny<string>(),
|
|
843 It.IsAny<string>(),
|
|
844 It.IsAny<string>(),
|
|
845 It.IsAny<string>()))
|
|
846 .Callback((arg1, arg2, arg3, arg4, arg5) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5));
|
|
847 </code>
|
|
848 </example>
|
|
849 </member>
|
|
850 <member name="M:Moq.Language.ICallback`2.Callback``6(System.Action{``0,``1,``2,``3,``4,``5})">
|
|
851 <summary>
|
|
852 Specifies a callback to invoke when the method is called that receives the original
|
|
853 arguments.
|
|
854 </summary>
|
|
855 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
856 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
857 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
858 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
859 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
860 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
861 <param name="action">The callback method to invoke.</param>
|
|
862 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
863 <example>
|
|
864 Invokes the given callback with the concrete invocation arguments values.
|
|
865 <para>
|
|
866 Notice how the specific arguments are retrieved by simply declaring
|
|
867 them as part of the lambda expression for the callback:
|
|
868 </para>
|
|
869 <code>
|
|
870 mock.Setup(x => x.Execute(
|
|
871 It.IsAny<string>(),
|
|
872 It.IsAny<string>(),
|
|
873 It.IsAny<string>(),
|
|
874 It.IsAny<string>(),
|
|
875 It.IsAny<string>(),
|
|
876 It.IsAny<string>()))
|
|
877 .Callback((arg1, arg2, arg3, arg4, arg5, arg6) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6));
|
|
878 </code>
|
|
879 </example>
|
|
880 </member>
|
|
881 <member name="M:Moq.Language.ICallback`2.Callback``7(System.Action{``0,``1,``2,``3,``4,``5,``6})">
|
|
882 <summary>
|
|
883 Specifies a callback to invoke when the method is called that receives the original
|
|
884 arguments.
|
|
885 </summary>
|
|
886 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
887 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
888 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
889 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
890 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
891 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
892 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
893 <param name="action">The callback method to invoke.</param>
|
|
894 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
895 <example>
|
|
896 Invokes the given callback with the concrete invocation arguments values.
|
|
897 <para>
|
|
898 Notice how the specific arguments are retrieved by simply declaring
|
|
899 them as part of the lambda expression for the callback:
|
|
900 </para>
|
|
901 <code>
|
|
902 mock.Setup(x => x.Execute(
|
|
903 It.IsAny<string>(),
|
|
904 It.IsAny<string>(),
|
|
905 It.IsAny<string>(),
|
|
906 It.IsAny<string>(),
|
|
907 It.IsAny<string>(),
|
|
908 It.IsAny<string>(),
|
|
909 It.IsAny<string>()))
|
|
910 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7));
|
|
911 </code>
|
|
912 </example>
|
|
913 </member>
|
|
914 <member name="M:Moq.Language.ICallback`2.Callback``8(System.Action{``0,``1,``2,``3,``4,``5,``6,``7})">
|
|
915 <summary>
|
|
916 Specifies a callback to invoke when the method is called that receives the original
|
|
917 arguments.
|
|
918 </summary>
|
|
919 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
920 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
921 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
922 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
923 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
924 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
925 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
926 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
927 <param name="action">The callback method to invoke.</param>
|
|
928 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
929 <example>
|
|
930 Invokes the given callback with the concrete invocation arguments values.
|
|
931 <para>
|
|
932 Notice how the specific arguments are retrieved by simply declaring
|
|
933 them as part of the lambda expression for the callback:
|
|
934 </para>
|
|
935 <code>
|
|
936 mock.Setup(x => x.Execute(
|
|
937 It.IsAny<string>(),
|
|
938 It.IsAny<string>(),
|
|
939 It.IsAny<string>(),
|
|
940 It.IsAny<string>(),
|
|
941 It.IsAny<string>(),
|
|
942 It.IsAny<string>(),
|
|
943 It.IsAny<string>(),
|
|
944 It.IsAny<string>()))
|
|
945 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8));
|
|
946 </code>
|
|
947 </example>
|
|
948 </member>
|
|
949 <member name="M:Moq.Language.ICallback`2.Callback``9(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8})">
|
|
950 <summary>
|
|
951 Specifies a callback to invoke when the method is called that receives the original
|
|
952 arguments.
|
|
953 </summary>
|
|
954 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
955 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
956 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
957 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
958 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
959 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
960 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
961 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
962 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
963 <param name="action">The callback method to invoke.</param>
|
|
964 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
965 <example>
|
|
966 Invokes the given callback with the concrete invocation arguments values.
|
|
967 <para>
|
|
968 Notice how the specific arguments are retrieved by simply declaring
|
|
969 them as part of the lambda expression for the callback:
|
|
970 </para>
|
|
971 <code>
|
|
972 mock.Setup(x => x.Execute(
|
|
973 It.IsAny<string>(),
|
|
974 It.IsAny<string>(),
|
|
975 It.IsAny<string>(),
|
|
976 It.IsAny<string>(),
|
|
977 It.IsAny<string>(),
|
|
978 It.IsAny<string>(),
|
|
979 It.IsAny<string>(),
|
|
980 It.IsAny<string>(),
|
|
981 It.IsAny<string>()))
|
|
982 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9));
|
|
983 </code>
|
|
984 </example>
|
|
985 </member>
|
|
986 <member name="M:Moq.Language.ICallback`2.Callback``10(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9})">
|
|
987 <summary>
|
|
988 Specifies a callback to invoke when the method is called that receives the original
|
|
989 arguments.
|
|
990 </summary>
|
|
991 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
992 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
993 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
994 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
995 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
996 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
997 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
998 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
999 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1000 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1001 <param name="action">The callback method to invoke.</param>
|
|
1002 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
1003 <example>
|
|
1004 Invokes the given callback with the concrete invocation arguments values.
|
|
1005 <para>
|
|
1006 Notice how the specific arguments are retrieved by simply declaring
|
|
1007 them as part of the lambda expression for the callback:
|
|
1008 </para>
|
|
1009 <code>
|
|
1010 mock.Setup(x => x.Execute(
|
|
1011 It.IsAny<string>(),
|
|
1012 It.IsAny<string>(),
|
|
1013 It.IsAny<string>(),
|
|
1014 It.IsAny<string>(),
|
|
1015 It.IsAny<string>(),
|
|
1016 It.IsAny<string>(),
|
|
1017 It.IsAny<string>(),
|
|
1018 It.IsAny<string>(),
|
|
1019 It.IsAny<string>(),
|
|
1020 It.IsAny<string>()))
|
|
1021 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10));
|
|
1022 </code>
|
|
1023 </example>
|
|
1024 </member>
|
|
1025 <member name="M:Moq.Language.ICallback`2.Callback``11(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10})">
|
|
1026 <summary>
|
|
1027 Specifies a callback to invoke when the method is called that receives the original
|
|
1028 arguments.
|
|
1029 </summary>
|
|
1030 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1031 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1032 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1033 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1034 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1035 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1036 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1037 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1038 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1039 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1040 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
1041 <param name="action">The callback method to invoke.</param>
|
|
1042 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
1043 <example>
|
|
1044 Invokes the given callback with the concrete invocation arguments values.
|
|
1045 <para>
|
|
1046 Notice how the specific arguments are retrieved by simply declaring
|
|
1047 them as part of the lambda expression for the callback:
|
|
1048 </para>
|
|
1049 <code>
|
|
1050 mock.Setup(x => x.Execute(
|
|
1051 It.IsAny<string>(),
|
|
1052 It.IsAny<string>(),
|
|
1053 It.IsAny<string>(),
|
|
1054 It.IsAny<string>(),
|
|
1055 It.IsAny<string>(),
|
|
1056 It.IsAny<string>(),
|
|
1057 It.IsAny<string>(),
|
|
1058 It.IsAny<string>(),
|
|
1059 It.IsAny<string>(),
|
|
1060 It.IsAny<string>(),
|
|
1061 It.IsAny<string>()))
|
|
1062 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11));
|
|
1063 </code>
|
|
1064 </example>
|
|
1065 </member>
|
|
1066 <member name="M:Moq.Language.ICallback`2.Callback``12(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11})">
|
|
1067 <summary>
|
|
1068 Specifies a callback to invoke when the method is called that receives the original
|
|
1069 arguments.
|
|
1070 </summary>
|
|
1071 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1072 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1073 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1074 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1075 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1076 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1077 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1078 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1079 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1080 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1081 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
1082 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
1083 <param name="action">The callback method to invoke.</param>
|
|
1084 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
1085 <example>
|
|
1086 Invokes the given callback with the concrete invocation arguments values.
|
|
1087 <para>
|
|
1088 Notice how the specific arguments are retrieved by simply declaring
|
|
1089 them as part of the lambda expression for the callback:
|
|
1090 </para>
|
|
1091 <code>
|
|
1092 mock.Setup(x => x.Execute(
|
|
1093 It.IsAny<string>(),
|
|
1094 It.IsAny<string>(),
|
|
1095 It.IsAny<string>(),
|
|
1096 It.IsAny<string>(),
|
|
1097 It.IsAny<string>(),
|
|
1098 It.IsAny<string>(),
|
|
1099 It.IsAny<string>(),
|
|
1100 It.IsAny<string>(),
|
|
1101 It.IsAny<string>(),
|
|
1102 It.IsAny<string>(),
|
|
1103 It.IsAny<string>(),
|
|
1104 It.IsAny<string>()))
|
|
1105 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12));
|
|
1106 </code>
|
|
1107 </example>
|
|
1108 </member>
|
|
1109 <member name="M:Moq.Language.ICallback`2.Callback``13(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12})">
|
|
1110 <summary>
|
|
1111 Specifies a callback to invoke when the method is called that receives the original
|
|
1112 arguments.
|
|
1113 </summary>
|
|
1114 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1115 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1116 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1117 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1118 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1119 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1120 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1121 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1122 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1123 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1124 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
1125 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
1126 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
1127 <param name="action">The callback method to invoke.</param>
|
|
1128 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
1129 <example>
|
|
1130 Invokes the given callback with the concrete invocation arguments values.
|
|
1131 <para>
|
|
1132 Notice how the specific arguments are retrieved by simply declaring
|
|
1133 them as part of the lambda expression for the callback:
|
|
1134 </para>
|
|
1135 <code>
|
|
1136 mock.Setup(x => x.Execute(
|
|
1137 It.IsAny<string>(),
|
|
1138 It.IsAny<string>(),
|
|
1139 It.IsAny<string>(),
|
|
1140 It.IsAny<string>(),
|
|
1141 It.IsAny<string>(),
|
|
1142 It.IsAny<string>(),
|
|
1143 It.IsAny<string>(),
|
|
1144 It.IsAny<string>(),
|
|
1145 It.IsAny<string>(),
|
|
1146 It.IsAny<string>(),
|
|
1147 It.IsAny<string>(),
|
|
1148 It.IsAny<string>(),
|
|
1149 It.IsAny<string>()))
|
|
1150 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13));
|
|
1151 </code>
|
|
1152 </example>
|
|
1153 </member>
|
|
1154 <member name="M:Moq.Language.ICallback`2.Callback``14(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13})">
|
|
1155 <summary>
|
|
1156 Specifies a callback to invoke when the method is called that receives the original
|
|
1157 arguments.
|
|
1158 </summary>
|
|
1159 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1160 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1161 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1162 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1163 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1164 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1165 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1166 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1167 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1168 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1169 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
1170 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
1171 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
1172 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
1173 <param name="action">The callback method to invoke.</param>
|
|
1174 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
1175 <example>
|
|
1176 Invokes the given callback with the concrete invocation arguments values.
|
|
1177 <para>
|
|
1178 Notice how the specific arguments are retrieved by simply declaring
|
|
1179 them as part of the lambda expression for the callback:
|
|
1180 </para>
|
|
1181 <code>
|
|
1182 mock.Setup(x => x.Execute(
|
|
1183 It.IsAny<string>(),
|
|
1184 It.IsAny<string>(),
|
|
1185 It.IsAny<string>(),
|
|
1186 It.IsAny<string>(),
|
|
1187 It.IsAny<string>(),
|
|
1188 It.IsAny<string>(),
|
|
1189 It.IsAny<string>(),
|
|
1190 It.IsAny<string>(),
|
|
1191 It.IsAny<string>(),
|
|
1192 It.IsAny<string>(),
|
|
1193 It.IsAny<string>(),
|
|
1194 It.IsAny<string>(),
|
|
1195 It.IsAny<string>(),
|
|
1196 It.IsAny<string>()))
|
|
1197 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14));
|
|
1198 </code>
|
|
1199 </example>
|
|
1200 </member>
|
|
1201 <member name="M:Moq.Language.ICallback`2.Callback``15(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14})">
|
|
1202 <summary>
|
|
1203 Specifies a callback to invoke when the method is called that receives the original
|
|
1204 arguments.
|
|
1205 </summary>
|
|
1206 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1207 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1208 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1209 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1210 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1211 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1212 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1213 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1214 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1215 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1216 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
1217 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
1218 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
1219 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
1220 <typeparam name="T15">The type of the fifteenth argument of the invoked method.</typeparam>
|
|
1221 <param name="action">The callback method to invoke.</param>
|
|
1222 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
1223 <example>
|
|
1224 Invokes the given callback with the concrete invocation arguments values.
|
|
1225 <para>
|
|
1226 Notice how the specific arguments are retrieved by simply declaring
|
|
1227 them as part of the lambda expression for the callback:
|
|
1228 </para>
|
|
1229 <code>
|
|
1230 mock.Setup(x => x.Execute(
|
|
1231 It.IsAny<string>(),
|
|
1232 It.IsAny<string>(),
|
|
1233 It.IsAny<string>(),
|
|
1234 It.IsAny<string>(),
|
|
1235 It.IsAny<string>(),
|
|
1236 It.IsAny<string>(),
|
|
1237 It.IsAny<string>(),
|
|
1238 It.IsAny<string>(),
|
|
1239 It.IsAny<string>(),
|
|
1240 It.IsAny<string>(),
|
|
1241 It.IsAny<string>(),
|
|
1242 It.IsAny<string>(),
|
|
1243 It.IsAny<string>(),
|
|
1244 It.IsAny<string>(),
|
|
1245 It.IsAny<string>()))
|
|
1246 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15));
|
|
1247 </code>
|
|
1248 </example>
|
|
1249 </member>
|
|
1250 <member name="M:Moq.Language.ICallback`2.Callback``16(System.Action{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14,``15})">
|
|
1251 <summary>
|
|
1252 Specifies a callback to invoke when the method is called that receives the original
|
|
1253 arguments.
|
|
1254 </summary>
|
|
1255 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1256 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1257 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1258 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1259 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1260 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1261 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1262 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1263 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1264 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1265 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
1266 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
1267 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
1268 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
1269 <typeparam name="T15">The type of the fifteenth argument of the invoked method.</typeparam>
|
|
1270 <typeparam name="T16">The type of the sixteenth argument of the invoked method.</typeparam>
|
|
1271 <param name="action">The callback method to invoke.</param>
|
|
1272 <returns>A reference to <see cref="T:Moq.Language.Flow.IReturnsThrows`2"/> interface.</returns>
|
|
1273 <example>
|
|
1274 Invokes the given callback with the concrete invocation arguments values.
|
|
1275 <para>
|
|
1276 Notice how the specific arguments are retrieved by simply declaring
|
|
1277 them as part of the lambda expression for the callback:
|
|
1278 </para>
|
|
1279 <code>
|
|
1280 mock.Setup(x => x.Execute(
|
|
1281 It.IsAny<string>(),
|
|
1282 It.IsAny<string>(),
|
|
1283 It.IsAny<string>(),
|
|
1284 It.IsAny<string>(),
|
|
1285 It.IsAny<string>(),
|
|
1286 It.IsAny<string>(),
|
|
1287 It.IsAny<string>(),
|
|
1288 It.IsAny<string>(),
|
|
1289 It.IsAny<string>(),
|
|
1290 It.IsAny<string>(),
|
|
1291 It.IsAny<string>(),
|
|
1292 It.IsAny<string>(),
|
|
1293 It.IsAny<string>(),
|
|
1294 It.IsAny<string>(),
|
|
1295 It.IsAny<string>(),
|
|
1296 It.IsAny<string>()))
|
|
1297 .Callback((arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16) => Console.WriteLine(arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16));
|
|
1298 </code>
|
|
1299 </example>
|
|
1300 </member>
|
|
1301 <member name="T:Moq.Language.IRaise`1">
|
|
1302 <summary>
|
|
1303 Defines the <c>Raises</c> verb.
|
|
1304 </summary>
|
|
1305 </member>
|
|
1306 <member name="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)">
|
|
1307 <summary>
|
|
1308 Specifies the event that will be raised
|
|
1309 when the setup is met.
|
|
1310 </summary>
|
|
1311 <param name="eventExpression">An expression that represents an event attach or detach action.</param>
|
|
1312 <param name="args">The event arguments to pass for the raised event.</param>
|
|
1313 <example>
|
|
1314 The following example shows how to raise an event when
|
|
1315 the setup is met:
|
|
1316 <code>
|
|
1317 var mock = new Mock<IContainer>();
|
|
1318
|
|
1319 mock.Setup(add => add.Add(It.IsAny<string>(), It.IsAny<object>()))
|
|
1320 .Raises(add => add.Added += null, EventArgs.Empty);
|
|
1321 </code>
|
|
1322 </example>
|
|
1323 </member>
|
|
1324 <member name="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.Func{System.EventArgs})">
|
|
1325 <summary>
|
|
1326 Specifies the event that will be raised
|
|
1327 when the setup is matched.
|
|
1328 </summary>
|
|
1329 <param name="eventExpression">An expression that represents an event attach or detach action.</param>
|
|
1330 <param name="func">A function that will build the <see cref="T:System.EventArgs"/>
|
|
1331 to pass when raising the event.</param>
|
|
1332 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1333 </member>
|
|
1334 <member name="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.Object[])">
|
|
1335 <summary>
|
|
1336 Specifies the custom event that will be raised
|
|
1337 when the setup is matched.
|
|
1338 </summary>
|
|
1339 <param name="eventExpression">An expression that represents an event attach or detach action.</param>
|
|
1340 <param name="args">The arguments to pass to the custom delegate (non EventHandler-compatible).</param>
|
|
1341 </member>
|
|
1342 <member name="M:Moq.Language.IRaise`1.Raises``1(System.Action{`0},System.Func{``0,System.EventArgs})">
|
|
1343 <summary>
|
|
1344 Specifies the event that will be raised when the setup is matched.
|
|
1345 </summary>
|
|
1346 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1347 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1348 to pass when raising the event.</param>
|
|
1349 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1350 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1351 </member>
|
|
1352 <member name="M:Moq.Language.IRaise`1.Raises``2(System.Action{`0},System.Func{``0,``1,System.EventArgs})">
|
|
1353 <summary>
|
|
1354 Specifies the event that will be raised when the setup is matched.
|
|
1355 </summary>
|
|
1356 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1357 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1358 to pass when raising the event.</param>
|
|
1359 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1360 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1361 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1362 </member>
|
|
1363 <member name="M:Moq.Language.IRaise`1.Raises``3(System.Action{`0},System.Func{``0,``1,``2,System.EventArgs})">
|
|
1364 <summary>
|
|
1365 Specifies the event that will be raised when the setup is matched.
|
|
1366 </summary>
|
|
1367 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1368 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1369 to pass when raising the event.</param>
|
|
1370 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1371 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1372 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1373 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1374 </member>
|
|
1375 <member name="M:Moq.Language.IRaise`1.Raises``4(System.Action{`0},System.Func{``0,``1,``2,``3,System.EventArgs})">
|
|
1376 <summary>
|
|
1377 Specifies the event that will be raised when the setup is matched.
|
|
1378 </summary>
|
|
1379 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1380 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1381 to pass when raising the event.</param>
|
|
1382 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1383 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1384 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1385 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1386 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1387 </member>
|
|
1388 <member name="M:Moq.Language.IRaise`1.Raises``5(System.Action{`0},System.Func{``0,``1,``2,``3,``4,System.EventArgs})">
|
|
1389 <summary>
|
|
1390 Specifies the event that will be raised when the setup is matched.
|
|
1391 </summary>
|
|
1392 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1393 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1394 to pass when raising the event.</param>
|
|
1395 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1396 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1397 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1398 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1399 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1400 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1401 </member>
|
|
1402 <member name="M:Moq.Language.IRaise`1.Raises``6(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,System.EventArgs})">
|
|
1403 <summary>
|
|
1404 Specifies the event that will be raised when the setup is matched.
|
|
1405 </summary>
|
|
1406 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1407 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1408 to pass when raising the event.</param>
|
|
1409 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1410 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1411 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1412 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1413 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1414 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1415 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1416 </member>
|
|
1417 <member name="M:Moq.Language.IRaise`1.Raises``7(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,System.EventArgs})">
|
|
1418 <summary>
|
|
1419 Specifies the event that will be raised when the setup is matched.
|
|
1420 </summary>
|
|
1421 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1422 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1423 to pass when raising the event.</param>
|
|
1424 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1425 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1426 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1427 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1428 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1429 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1430 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1431 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1432 </member>
|
|
1433 <member name="M:Moq.Language.IRaise`1.Raises``8(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,System.EventArgs})">
|
|
1434 <summary>
|
|
1435 Specifies the event that will be raised when the setup is matched.
|
|
1436 </summary>
|
|
1437 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1438 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1439 to pass when raising the event.</param>
|
|
1440 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1441 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1442 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1443 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1444 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1445 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1446 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1447 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1448 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1449 </member>
|
|
1450 <member name="M:Moq.Language.IRaise`1.Raises``9(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,System.EventArgs})">
|
|
1451 <summary>
|
|
1452 Specifies the event that will be raised when the setup is matched.
|
|
1453 </summary>
|
|
1454 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1455 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1456 to pass when raising the event.</param>
|
|
1457 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1458 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1459 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1460 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1461 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1462 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1463 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1464 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1465 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1466 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1467 </member>
|
|
1468 <member name="M:Moq.Language.IRaise`1.Raises``10(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,System.EventArgs})">
|
|
1469 <summary>
|
|
1470 Specifies the event that will be raised when the setup is matched.
|
|
1471 </summary>
|
|
1472 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1473 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1474 to pass when raising the event.</param>
|
|
1475 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1476 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1477 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1478 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1479 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1480 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1481 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1482 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1483 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1484 <typeparam name="T10">The type of the tenth argument received by the expected invocation.</typeparam>
|
|
1485 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1486 </member>
|
|
1487 <member name="M:Moq.Language.IRaise`1.Raises``11(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,System.EventArgs})">
|
|
1488 <summary>
|
|
1489 Specifies the event that will be raised when the setup is matched.
|
|
1490 </summary>
|
|
1491 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1492 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1493 to pass when raising the event.</param>
|
|
1494 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1495 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1496 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1497 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1498 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1499 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1500 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1501 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1502 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1503 <typeparam name="T10">The type of the tenth argument received by the expected invocation.</typeparam>
|
|
1504 <typeparam name="T11">The type of the eleventh argument received by the expected invocation.</typeparam>
|
|
1505 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1506 </member>
|
|
1507 <member name="M:Moq.Language.IRaise`1.Raises``12(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,System.EventArgs})">
|
|
1508 <summary>
|
|
1509 Specifies the event that will be raised when the setup is matched.
|
|
1510 </summary>
|
|
1511 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1512 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1513 to pass when raising the event.</param>
|
|
1514 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1515 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1516 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1517 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1518 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1519 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1520 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1521 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1522 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1523 <typeparam name="T10">The type of the tenth argument received by the expected invocation.</typeparam>
|
|
1524 <typeparam name="T11">The type of the eleventh argument received by the expected invocation.</typeparam>
|
|
1525 <typeparam name="T12">The type of the twelfth argument received by the expected invocation.</typeparam>
|
|
1526 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1527 </member>
|
|
1528 <member name="M:Moq.Language.IRaise`1.Raises``13(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,System.EventArgs})">
|
|
1529 <summary>
|
|
1530 Specifies the event that will be raised when the setup is matched.
|
|
1531 </summary>
|
|
1532 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1533 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1534 to pass when raising the event.</param>
|
|
1535 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1536 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1537 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1538 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1539 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1540 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1541 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1542 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1543 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1544 <typeparam name="T10">The type of the tenth argument received by the expected invocation.</typeparam>
|
|
1545 <typeparam name="T11">The type of the eleventh argument received by the expected invocation.</typeparam>
|
|
1546 <typeparam name="T12">The type of the twelfth argument received by the expected invocation.</typeparam>
|
|
1547 <typeparam name="T13">The type of the thirteenth argument received by the expected invocation.</typeparam>
|
|
1548 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1549 </member>
|
|
1550 <member name="M:Moq.Language.IRaise`1.Raises``14(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,System.EventArgs})">
|
|
1551 <summary>
|
|
1552 Specifies the event that will be raised when the setup is matched.
|
|
1553 </summary>
|
|
1554 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1555 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1556 to pass when raising the event.</param>
|
|
1557 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1558 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1559 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1560 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1561 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1562 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1563 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1564 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1565 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1566 <typeparam name="T10">The type of the tenth argument received by the expected invocation.</typeparam>
|
|
1567 <typeparam name="T11">The type of the eleventh argument received by the expected invocation.</typeparam>
|
|
1568 <typeparam name="T12">The type of the twelfth argument received by the expected invocation.</typeparam>
|
|
1569 <typeparam name="T13">The type of the thirteenth argument received by the expected invocation.</typeparam>
|
|
1570 <typeparam name="T14">The type of the fourteenth argument received by the expected invocation.</typeparam>
|
|
1571 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1572 </member>
|
|
1573 <member name="M:Moq.Language.IRaise`1.Raises``15(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14,System.EventArgs})">
|
|
1574 <summary>
|
|
1575 Specifies the event that will be raised when the setup is matched.
|
|
1576 </summary>
|
|
1577 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1578 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1579 to pass when raising the event.</param>
|
|
1580 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1581 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1582 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1583 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1584 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1585 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1586 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1587 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1588 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1589 <typeparam name="T10">The type of the tenth argument received by the expected invocation.</typeparam>
|
|
1590 <typeparam name="T11">The type of the eleventh argument received by the expected invocation.</typeparam>
|
|
1591 <typeparam name="T12">The type of the twelfth argument received by the expected invocation.</typeparam>
|
|
1592 <typeparam name="T13">The type of the thirteenth argument received by the expected invocation.</typeparam>
|
|
1593 <typeparam name="T14">The type of the fourteenth argument received by the expected invocation.</typeparam>
|
|
1594 <typeparam name="T15">The type of the fifteenth argument received by the expected invocation.</typeparam>
|
|
1595 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1596 </member>
|
|
1597 <member name="M:Moq.Language.IRaise`1.Raises``16(System.Action{`0},System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14,``15,System.EventArgs})">
|
|
1598 <summary>
|
|
1599 Specifies the event that will be raised when the setup is matched.
|
|
1600 </summary>
|
|
1601 <param name="eventExpression">The expression that represents an event attach or detach action.</param>
|
|
1602 <param name="func">The function that will build the <see cref="T:System.EventArgs"/>
|
|
1603 to pass when raising the event.</param>
|
|
1604 <typeparam name="T1">The type of the first argument received by the expected invocation.</typeparam>
|
|
1605 <typeparam name="T2">The type of the second argument received by the expected invocation.</typeparam>
|
|
1606 <typeparam name="T3">The type of the third argument received by the expected invocation.</typeparam>
|
|
1607 <typeparam name="T4">The type of the fourth argument received by the expected invocation.</typeparam>
|
|
1608 <typeparam name="T5">The type of the fifth argument received by the expected invocation.</typeparam>
|
|
1609 <typeparam name="T6">The type of the sixth argument received by the expected invocation.</typeparam>
|
|
1610 <typeparam name="T7">The type of the seventh argument received by the expected invocation.</typeparam>
|
|
1611 <typeparam name="T8">The type of the eighth argument received by the expected invocation.</typeparam>
|
|
1612 <typeparam name="T9">The type of the nineth argument received by the expected invocation.</typeparam>
|
|
1613 <typeparam name="T10">The type of the tenth argument received by the expected invocation.</typeparam>
|
|
1614 <typeparam name="T11">The type of the eleventh argument received by the expected invocation.</typeparam>
|
|
1615 <typeparam name="T12">The type of the twelfth argument received by the expected invocation.</typeparam>
|
|
1616 <typeparam name="T13">The type of the thirteenth argument received by the expected invocation.</typeparam>
|
|
1617 <typeparam name="T14">The type of the fourteenth argument received by the expected invocation.</typeparam>
|
|
1618 <typeparam name="T15">The type of the fifteenth argument received by the expected invocation.</typeparam>
|
|
1619 <typeparam name="T16">The type of the sixteenth argument received by the expected invocation.</typeparam>
|
|
1620 <seealso cref="M:Moq.Language.IRaise`1.Raises(System.Action{`0},System.EventArgs)"/>
|
|
1621 </member>
|
|
1622 <member name="T:Moq.Language.IReturns`2">
|
|
1623 <summary>
|
|
1624 Defines the <c>Returns</c> verb.
|
|
1625 </summary>
|
|
1626 <typeparam name="TMock">Mocked type.</typeparam>
|
|
1627 <typeparam name="TResult">Type of the return value from the expression.</typeparam>
|
|
1628 </member>
|
|
1629 <member name="M:Moq.Language.IReturns`2.Returns(`1)">
|
|
1630 <summary>
|
|
1631 Specifies the value to return.
|
|
1632 </summary>
|
|
1633 <param name="value">The value to return, or <see langword="null"/>.</param>
|
|
1634 <example>
|
|
1635 Return a <c>true</c> value from the method call:
|
|
1636 <code>
|
|
1637 mock.Setup(x => x.Execute("ping"))
|
|
1638 .Returns(true);
|
|
1639 </code>
|
|
1640 </example>
|
|
1641 </member>
|
|
1642 <member name="M:Moq.Language.IReturns`2.Returns(System.Func{`1})">
|
|
1643 <summary>
|
|
1644 Specifies a function that will calculate the value to return from the method.
|
|
1645 </summary>
|
|
1646 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1647 <example group="returns">
|
|
1648 Return a calculated value when the method is called:
|
|
1649 <code>
|
|
1650 mock.Setup(x => x.Execute("ping"))
|
|
1651 .Returns(() => returnValues[0]);
|
|
1652 </code>
|
|
1653 The lambda expression to retrieve the return value is lazy-executed,
|
|
1654 meaning that its value may change depending on the moment the method
|
|
1655 is executed and the value the <c>returnValues</c> array has at
|
|
1656 that moment.
|
|
1657 </example>
|
|
1658 </member>
|
|
1659 <member name="M:Moq.Language.IReturns`2.Returns``1(System.Func{``0,`1})">
|
|
1660 <summary>
|
|
1661 Specifies a function that will calculate the value to return from the method,
|
|
1662 retrieving the arguments for the invocation.
|
|
1663 </summary>
|
|
1664 <typeparam name="T">The type of the argument of the invoked method.</typeparam>
|
|
1665 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1666 <example group="returns">
|
|
1667 Return a calculated value which is evaluated lazily at the time of the invocation.
|
|
1668 <para>
|
|
1669 The lookup list can change between invocations and the setup
|
|
1670 will return different values accordingly. Also, notice how the specific
|
|
1671 string argument is retrieved by simply declaring it as part of the lambda
|
|
1672 expression:
|
|
1673 </para>
|
|
1674 <code>
|
|
1675 mock.Setup(x => x.Execute(It.IsAny<string>()))
|
|
1676 .Returns((string command) => returnValues[command]);
|
|
1677 </code>
|
|
1678 </example>
|
|
1679 </member>
|
|
1680 <member name="M:Moq.Language.IReturns`2.CallBase">
|
|
1681 <summary>
|
|
1682 Calls the real method of the object and returns its return value.
|
|
1683 </summary>
|
|
1684 <returns>The value calculated by the real method of the object.</returns>
|
|
1685 </member>
|
|
1686 <member name="M:Moq.Language.IReturns`2.Returns``2(System.Func{``0,``1,`1})">
|
|
1687 <summary>
|
|
1688 Specifies a function that will calculate the value to return from the method,
|
|
1689 retrieving the arguments for the invocation.
|
|
1690 </summary>
|
|
1691 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1692 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1693 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1694 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1695 <example>
|
|
1696 <para>
|
|
1697 The return value is calculated from the value of the actual method invocation arguments.
|
|
1698 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1699 expression:
|
|
1700 </para>
|
|
1701 <code>
|
|
1702 mock.Setup(x => x.Execute(
|
|
1703 It.IsAny<int>(),
|
|
1704 It.IsAny<int>()))
|
|
1705 .Returns((string arg1, string arg2) => arg1 + arg2);
|
|
1706 </code>
|
|
1707 </example>
|
|
1708 </member>
|
|
1709 <member name="M:Moq.Language.IReturns`2.Returns``3(System.Func{``0,``1,``2,`1})">
|
|
1710 <summary>
|
|
1711 Specifies a function that will calculate the value to return from the method,
|
|
1712 retrieving the arguments for the invocation.
|
|
1713 </summary>
|
|
1714 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1715 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1716 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1717 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1718 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1719 <example>
|
|
1720 <para>
|
|
1721 The return value is calculated from the value of the actual method invocation arguments.
|
|
1722 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1723 expression:
|
|
1724 </para>
|
|
1725 <code>
|
|
1726 mock.Setup(x => x.Execute(
|
|
1727 It.IsAny<int>(),
|
|
1728 It.IsAny<int>(),
|
|
1729 It.IsAny<int>()))
|
|
1730 .Returns((string arg1, string arg2, string arg3) => arg1 + arg2 + arg3);
|
|
1731 </code>
|
|
1732 </example>
|
|
1733 </member>
|
|
1734 <member name="M:Moq.Language.IReturns`2.Returns``4(System.Func{``0,``1,``2,``3,`1})">
|
|
1735 <summary>
|
|
1736 Specifies a function that will calculate the value to return from the method,
|
|
1737 retrieving the arguments for the invocation.
|
|
1738 </summary>
|
|
1739 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1740 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1741 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1742 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1743 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1744 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1745 <example>
|
|
1746 <para>
|
|
1747 The return value is calculated from the value of the actual method invocation arguments.
|
|
1748 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1749 expression:
|
|
1750 </para>
|
|
1751 <code>
|
|
1752 mock.Setup(x => x.Execute(
|
|
1753 It.IsAny<int>(),
|
|
1754 It.IsAny<int>(),
|
|
1755 It.IsAny<int>(),
|
|
1756 It.IsAny<int>()))
|
|
1757 .Returns((string arg1, string arg2, string arg3, string arg4) => arg1 + arg2 + arg3 + arg4);
|
|
1758 </code>
|
|
1759 </example>
|
|
1760 </member>
|
|
1761 <member name="M:Moq.Language.IReturns`2.Returns``5(System.Func{``0,``1,``2,``3,``4,`1})">
|
|
1762 <summary>
|
|
1763 Specifies a function that will calculate the value to return from the method,
|
|
1764 retrieving the arguments for the invocation.
|
|
1765 </summary>
|
|
1766 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1767 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1768 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1769 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1770 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1771 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1772 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1773 <example>
|
|
1774 <para>
|
|
1775 The return value is calculated from the value of the actual method invocation arguments.
|
|
1776 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1777 expression:
|
|
1778 </para>
|
|
1779 <code>
|
|
1780 mock.Setup(x => x.Execute(
|
|
1781 It.IsAny<int>(),
|
|
1782 It.IsAny<int>(),
|
|
1783 It.IsAny<int>(),
|
|
1784 It.IsAny<int>(),
|
|
1785 It.IsAny<int>()))
|
|
1786 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5) => arg1 + arg2 + arg3 + arg4 + arg5);
|
|
1787 </code>
|
|
1788 </example>
|
|
1789 </member>
|
|
1790 <member name="M:Moq.Language.IReturns`2.Returns``6(System.Func{``0,``1,``2,``3,``4,``5,`1})">
|
|
1791 <summary>
|
|
1792 Specifies a function that will calculate the value to return from the method,
|
|
1793 retrieving the arguments for the invocation.
|
|
1794 </summary>
|
|
1795 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1796 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1797 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1798 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1799 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1800 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1801 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1802 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1803 <example>
|
|
1804 <para>
|
|
1805 The return value is calculated from the value of the actual method invocation arguments.
|
|
1806 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1807 expression:
|
|
1808 </para>
|
|
1809 <code>
|
|
1810 mock.Setup(x => x.Execute(
|
|
1811 It.IsAny<int>(),
|
|
1812 It.IsAny<int>(),
|
|
1813 It.IsAny<int>(),
|
|
1814 It.IsAny<int>(),
|
|
1815 It.IsAny<int>(),
|
|
1816 It.IsAny<int>()))
|
|
1817 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6);
|
|
1818 </code>
|
|
1819 </example>
|
|
1820 </member>
|
|
1821 <member name="M:Moq.Language.IReturns`2.Returns``7(System.Func{``0,``1,``2,``3,``4,``5,``6,`1})">
|
|
1822 <summary>
|
|
1823 Specifies a function that will calculate the value to return from the method,
|
|
1824 retrieving the arguments for the invocation.
|
|
1825 </summary>
|
|
1826 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1827 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1828 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1829 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1830 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1831 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1832 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1833 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1834 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1835 <example>
|
|
1836 <para>
|
|
1837 The return value is calculated from the value of the actual method invocation arguments.
|
|
1838 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1839 expression:
|
|
1840 </para>
|
|
1841 <code>
|
|
1842 mock.Setup(x => x.Execute(
|
|
1843 It.IsAny<int>(),
|
|
1844 It.IsAny<int>(),
|
|
1845 It.IsAny<int>(),
|
|
1846 It.IsAny<int>(),
|
|
1847 It.IsAny<int>(),
|
|
1848 It.IsAny<int>(),
|
|
1849 It.IsAny<int>()))
|
|
1850 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7);
|
|
1851 </code>
|
|
1852 </example>
|
|
1853 </member>
|
|
1854 <member name="M:Moq.Language.IReturns`2.Returns``8(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,`1})">
|
|
1855 <summary>
|
|
1856 Specifies a function that will calculate the value to return from the method,
|
|
1857 retrieving the arguments for the invocation.
|
|
1858 </summary>
|
|
1859 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1860 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1861 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1862 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1863 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1864 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1865 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1866 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1867 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1868 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1869 <example>
|
|
1870 <para>
|
|
1871 The return value is calculated from the value of the actual method invocation arguments.
|
|
1872 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1873 expression:
|
|
1874 </para>
|
|
1875 <code>
|
|
1876 mock.Setup(x => x.Execute(
|
|
1877 It.IsAny<int>(),
|
|
1878 It.IsAny<int>(),
|
|
1879 It.IsAny<int>(),
|
|
1880 It.IsAny<int>(),
|
|
1881 It.IsAny<int>(),
|
|
1882 It.IsAny<int>(),
|
|
1883 It.IsAny<int>(),
|
|
1884 It.IsAny<int>()))
|
|
1885 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8);
|
|
1886 </code>
|
|
1887 </example>
|
|
1888 </member>
|
|
1889 <member name="M:Moq.Language.IReturns`2.Returns``9(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,`1})">
|
|
1890 <summary>
|
|
1891 Specifies a function that will calculate the value to return from the method,
|
|
1892 retrieving the arguments for the invocation.
|
|
1893 </summary>
|
|
1894 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1895 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1896 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1897 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1898 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1899 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1900 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1901 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1902 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1903 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1904 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1905 <example>
|
|
1906 <para>
|
|
1907 The return value is calculated from the value of the actual method invocation arguments.
|
|
1908 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1909 expression:
|
|
1910 </para>
|
|
1911 <code>
|
|
1912 mock.Setup(x => x.Execute(
|
|
1913 It.IsAny<int>(),
|
|
1914 It.IsAny<int>(),
|
|
1915 It.IsAny<int>(),
|
|
1916 It.IsAny<int>(),
|
|
1917 It.IsAny<int>(),
|
|
1918 It.IsAny<int>(),
|
|
1919 It.IsAny<int>(),
|
|
1920 It.IsAny<int>(),
|
|
1921 It.IsAny<int>()))
|
|
1922 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9);
|
|
1923 </code>
|
|
1924 </example>
|
|
1925 </member>
|
|
1926 <member name="M:Moq.Language.IReturns`2.Returns``10(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,`1})">
|
|
1927 <summary>
|
|
1928 Specifies a function that will calculate the value to return from the method,
|
|
1929 retrieving the arguments for the invocation.
|
|
1930 </summary>
|
|
1931 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1932 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1933 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1934 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1935 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1936 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1937 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1938 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1939 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1940 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1941 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1942 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1943 <example>
|
|
1944 <para>
|
|
1945 The return value is calculated from the value of the actual method invocation arguments.
|
|
1946 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1947 expression:
|
|
1948 </para>
|
|
1949 <code>
|
|
1950 mock.Setup(x => x.Execute(
|
|
1951 It.IsAny<int>(),
|
|
1952 It.IsAny<int>(),
|
|
1953 It.IsAny<int>(),
|
|
1954 It.IsAny<int>(),
|
|
1955 It.IsAny<int>(),
|
|
1956 It.IsAny<int>(),
|
|
1957 It.IsAny<int>(),
|
|
1958 It.IsAny<int>(),
|
|
1959 It.IsAny<int>(),
|
|
1960 It.IsAny<int>()))
|
|
1961 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10);
|
|
1962 </code>
|
|
1963 </example>
|
|
1964 </member>
|
|
1965 <member name="M:Moq.Language.IReturns`2.Returns``11(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,`1})">
|
|
1966 <summary>
|
|
1967 Specifies a function that will calculate the value to return from the method,
|
|
1968 retrieving the arguments for the invocation.
|
|
1969 </summary>
|
|
1970 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
1971 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
1972 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
1973 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
1974 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
1975 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
1976 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
1977 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
1978 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
1979 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
1980 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
1981 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
1982 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
1983 <example>
|
|
1984 <para>
|
|
1985 The return value is calculated from the value of the actual method invocation arguments.
|
|
1986 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
1987 expression:
|
|
1988 </para>
|
|
1989 <code>
|
|
1990 mock.Setup(x => x.Execute(
|
|
1991 It.IsAny<int>(),
|
|
1992 It.IsAny<int>(),
|
|
1993 It.IsAny<int>(),
|
|
1994 It.IsAny<int>(),
|
|
1995 It.IsAny<int>(),
|
|
1996 It.IsAny<int>(),
|
|
1997 It.IsAny<int>(),
|
|
1998 It.IsAny<int>(),
|
|
1999 It.IsAny<int>(),
|
|
2000 It.IsAny<int>(),
|
|
2001 It.IsAny<int>()))
|
|
2002 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11);
|
|
2003 </code>
|
|
2004 </example>
|
|
2005 </member>
|
|
2006 <member name="M:Moq.Language.IReturns`2.Returns``12(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,`1})">
|
|
2007 <summary>
|
|
2008 Specifies a function that will calculate the value to return from the method,
|
|
2009 retrieving the arguments for the invocation.
|
|
2010 </summary>
|
|
2011 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
2012 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
2013 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
2014 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
2015 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
2016 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
2017 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
2018 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
2019 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
2020 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
2021 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
2022 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
2023 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
2024 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
2025 <example>
|
|
2026 <para>
|
|
2027 The return value is calculated from the value of the actual method invocation arguments.
|
|
2028 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
2029 expression:
|
|
2030 </para>
|
|
2031 <code>
|
|
2032 mock.Setup(x => x.Execute(
|
|
2033 It.IsAny<int>(),
|
|
2034 It.IsAny<int>(),
|
|
2035 It.IsAny<int>(),
|
|
2036 It.IsAny<int>(),
|
|
2037 It.IsAny<int>(),
|
|
2038 It.IsAny<int>(),
|
|
2039 It.IsAny<int>(),
|
|
2040 It.IsAny<int>(),
|
|
2041 It.IsAny<int>(),
|
|
2042 It.IsAny<int>(),
|
|
2043 It.IsAny<int>(),
|
|
2044 It.IsAny<int>()))
|
|
2045 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12);
|
|
2046 </code>
|
|
2047 </example>
|
|
2048 </member>
|
|
2049 <member name="M:Moq.Language.IReturns`2.Returns``13(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,`1})">
|
|
2050 <summary>
|
|
2051 Specifies a function that will calculate the value to return from the method,
|
|
2052 retrieving the arguments for the invocation.
|
|
2053 </summary>
|
|
2054 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
2055 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
2056 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
2057 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
2058 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
2059 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
2060 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
2061 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
2062 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
2063 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
2064 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
2065 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
2066 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
2067 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
2068 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
2069 <example>
|
|
2070 <para>
|
|
2071 The return value is calculated from the value of the actual method invocation arguments.
|
|
2072 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
2073 expression:
|
|
2074 </para>
|
|
2075 <code>
|
|
2076 mock.Setup(x => x.Execute(
|
|
2077 It.IsAny<int>(),
|
|
2078 It.IsAny<int>(),
|
|
2079 It.IsAny<int>(),
|
|
2080 It.IsAny<int>(),
|
|
2081 It.IsAny<int>(),
|
|
2082 It.IsAny<int>(),
|
|
2083 It.IsAny<int>(),
|
|
2084 It.IsAny<int>(),
|
|
2085 It.IsAny<int>(),
|
|
2086 It.IsAny<int>(),
|
|
2087 It.IsAny<int>(),
|
|
2088 It.IsAny<int>(),
|
|
2089 It.IsAny<int>()))
|
|
2090 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13);
|
|
2091 </code>
|
|
2092 </example>
|
|
2093 </member>
|
|
2094 <member name="M:Moq.Language.IReturns`2.Returns``14(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,`1})">
|
|
2095 <summary>
|
|
2096 Specifies a function that will calculate the value to return from the method,
|
|
2097 retrieving the arguments for the invocation.
|
|
2098 </summary>
|
|
2099 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
2100 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
2101 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
2102 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
2103 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
2104 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
2105 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
2106 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
2107 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
2108 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
2109 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
2110 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
2111 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
2112 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
2113 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
2114 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
2115 <example>
|
|
2116 <para>
|
|
2117 The return value is calculated from the value of the actual method invocation arguments.
|
|
2118 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
2119 expression:
|
|
2120 </para>
|
|
2121 <code>
|
|
2122 mock.Setup(x => x.Execute(
|
|
2123 It.IsAny<int>(),
|
|
2124 It.IsAny<int>(),
|
|
2125 It.IsAny<int>(),
|
|
2126 It.IsAny<int>(),
|
|
2127 It.IsAny<int>(),
|
|
2128 It.IsAny<int>(),
|
|
2129 It.IsAny<int>(),
|
|
2130 It.IsAny<int>(),
|
|
2131 It.IsAny<int>(),
|
|
2132 It.IsAny<int>(),
|
|
2133 It.IsAny<int>(),
|
|
2134 It.IsAny<int>(),
|
|
2135 It.IsAny<int>(),
|
|
2136 It.IsAny<int>()))
|
|
2137 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14);
|
|
2138 </code>
|
|
2139 </example>
|
|
2140 </member>
|
|
2141 <member name="M:Moq.Language.IReturns`2.Returns``15(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14,`1})">
|
|
2142 <summary>
|
|
2143 Specifies a function that will calculate the value to return from the method,
|
|
2144 retrieving the arguments for the invocation.
|
|
2145 </summary>
|
|
2146 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
2147 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
2148 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
2149 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
2150 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
2151 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
2152 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
2153 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
2154 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
2155 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
2156 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
2157 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
2158 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
2159 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
2160 <typeparam name="T15">The type of the fifteenth argument of the invoked method.</typeparam>
|
|
2161 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
2162 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
2163 <example>
|
|
2164 <para>
|
|
2165 The return value is calculated from the value of the actual method invocation arguments.
|
|
2166 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
2167 expression:
|
|
2168 </para>
|
|
2169 <code>
|
|
2170 mock.Setup(x => x.Execute(
|
|
2171 It.IsAny<int>(),
|
|
2172 It.IsAny<int>(),
|
|
2173 It.IsAny<int>(),
|
|
2174 It.IsAny<int>(),
|
|
2175 It.IsAny<int>(),
|
|
2176 It.IsAny<int>(),
|
|
2177 It.IsAny<int>(),
|
|
2178 It.IsAny<int>(),
|
|
2179 It.IsAny<int>(),
|
|
2180 It.IsAny<int>(),
|
|
2181 It.IsAny<int>(),
|
|
2182 It.IsAny<int>(),
|
|
2183 It.IsAny<int>(),
|
|
2184 It.IsAny<int>(),
|
|
2185 It.IsAny<int>()))
|
|
2186 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15);
|
|
2187 </code>
|
|
2188 </example>
|
|
2189 </member>
|
|
2190 <member name="M:Moq.Language.IReturns`2.Returns``16(System.Func{``0,``1,``2,``3,``4,``5,``6,``7,``8,``9,``10,``11,``12,``13,``14,``15,`1})">
|
|
2191 <summary>
|
|
2192 Specifies a function that will calculate the value to return from the method,
|
|
2193 retrieving the arguments for the invocation.
|
|
2194 </summary>
|
|
2195 <typeparam name="T1">The type of the first argument of the invoked method.</typeparam>
|
|
2196 <typeparam name="T2">The type of the second argument of the invoked method.</typeparam>
|
|
2197 <typeparam name="T3">The type of the third argument of the invoked method.</typeparam>
|
|
2198 <typeparam name="T4">The type of the fourth argument of the invoked method.</typeparam>
|
|
2199 <typeparam name="T5">The type of the fifth argument of the invoked method.</typeparam>
|
|
2200 <typeparam name="T6">The type of the sixth argument of the invoked method.</typeparam>
|
|
2201 <typeparam name="T7">The type of the seventh argument of the invoked method.</typeparam>
|
|
2202 <typeparam name="T8">The type of the eighth argument of the invoked method.</typeparam>
|
|
2203 <typeparam name="T9">The type of the nineth argument of the invoked method.</typeparam>
|
|
2204 <typeparam name="T10">The type of the tenth argument of the invoked method.</typeparam>
|
|
2205 <typeparam name="T11">The type of the eleventh argument of the invoked method.</typeparam>
|
|
2206 <typeparam name="T12">The type of the twelfth argument of the invoked method.</typeparam>
|
|
2207 <typeparam name="T13">The type of the thirteenth argument of the invoked method.</typeparam>
|
|
2208 <typeparam name="T14">The type of the fourteenth argument of the invoked method.</typeparam>
|
|
2209 <typeparam name="T15">The type of the fifteenth argument of the invoked method.</typeparam>
|
|
2210 <typeparam name="T16">The type of the sixteenth argument of the invoked method.</typeparam>
|
|
2211 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
2212 <return>Returns a calculated value which is evaluated lazily at the time of the invocation.</return>
|
|
2213 <example>
|
|
2214 <para>
|
|
2215 The return value is calculated from the value of the actual method invocation arguments.
|
|
2216 Notice how the arguments are retrieved by simply declaring them as part of the lambda
|
|
2217 expression:
|
|
2218 </para>
|
|
2219 <code>
|
|
2220 mock.Setup(x => x.Execute(
|
|
2221 It.IsAny<int>(),
|
|
2222 It.IsAny<int>(),
|
|
2223 It.IsAny<int>(),
|
|
2224 It.IsAny<int>(),
|
|
2225 It.IsAny<int>(),
|
|
2226 It.IsAny<int>(),
|
|
2227 It.IsAny<int>(),
|
|
2228 It.IsAny<int>(),
|
|
2229 It.IsAny<int>(),
|
|
2230 It.IsAny<int>(),
|
|
2231 It.IsAny<int>(),
|
|
2232 It.IsAny<int>(),
|
|
2233 It.IsAny<int>(),
|
|
2234 It.IsAny<int>(),
|
|
2235 It.IsAny<int>(),
|
|
2236 It.IsAny<int>()))
|
|
2237 .Returns((string arg1, string arg2, string arg3, string arg4, string arg5, string arg6, string arg7, string arg8, string arg9, string arg10, string arg11, string arg12, string arg13, string arg14, string arg15, string arg16) => arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10 + arg11 + arg12 + arg13 + arg14 + arg15 + arg16);
|
|
2238 </code>
|
|
2239 </example>
|
|
2240 </member>
|
|
2241 <member name="T:Moq.Language.ISetupSequentialResult`1">
|
|
2242 <summary>
|
|
2243 Language for ReturnSequence
|
|
2244 </summary>
|
|
2245 </member>
|
|
2246 <member name="M:Moq.Language.ISetupSequentialResult`1.Returns(`0)">
|
|
2247 <summary>
|
|
2248 Returns value
|
|
2249 </summary>
|
|
2250 </member>
|
|
2251 <member name="M:Moq.Language.ISetupSequentialResult`1.Throws(System.Exception)">
|
|
2252 <summary>
|
|
2253 Throws an exception
|
|
2254 </summary>
|
|
2255 </member>
|
|
2256 <member name="M:Moq.Language.ISetupSequentialResult`1.Throws``1">
|
|
2257 <summary>
|
|
2258 Throws an exception
|
|
2259 </summary>
|
|
2260 </member>
|
|
2261 <member name="M:Moq.Language.ISetupSequentialResult`1.CallBase">
|
|
2262 <summary>
|
|
2263 Calls original method
|
|
2264 </summary>
|
|
2265 </member>
|
|
2266 <member name="F:Moq.Linq.FluentMockVisitor.isFirst">
|
|
2267 <summary>
|
|
2268 The first method call or member access will be the
|
|
2269 last segment of the expression (depth-first traversal),
|
|
2270 which is the one we have to Setup rather than FluentMock.
|
|
2271 And the last one is the one we have to Mock.Get rather
|
|
2272 than FluentMock.
|
|
2273 </summary>
|
|
2274 </member>
|
|
2275 <member name="T:Moq.Mock">
|
|
2276 <summary>
|
|
2277 Base class for mocks and static helper class with methods that
|
|
2278 apply to mocked objects, such as <see cref="M:Moq.Mock.Get``1(``0)"/> to
|
|
2279 retrieve a <see cref="T:Moq.Mock`1"/> from an object instance.
|
|
2280 </summary>
|
|
2281 </member>
|
|
2282 <member name="M:Moq.Mock.Of``1">
|
|
2283 <summary>
|
|
2284 Creates an mock object of the indicated type.
|
|
2285 </summary>
|
|
2286 <typeparam name="T">The type of the mocked object.</typeparam>
|
|
2287 <returns>The mocked object created.</returns>
|
|
2288 </member>
|
|
2289 <member name="M:Moq.Mock.Of``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
|
2290 <summary>
|
|
2291 Creates an mock object of the indicated type.
|
|
2292 </summary>
|
|
2293 <param name="predicate">The predicate with the specification of how the mocked object should behave.</param>
|
|
2294 <typeparam name="T">The type of the mocked object.</typeparam>
|
|
2295 <returns>The mocked object created.</returns>
|
|
2296 </member>
|
|
2297 <member name="M:Moq.Mock.#ctor">
|
|
2298 <summary>
|
|
2299 Initializes a new instance of the <see cref="T:Moq.Mock"/> class.
|
|
2300 </summary>
|
|
2301 </member>
|
|
2302 <member name="M:Moq.Mock.Get``1(``0)">
|
|
2303 <summary>
|
|
2304 Retrieves the mock object for the given object instance.
|
|
2305 </summary><typeparam name="T">
|
|
2306 Type of the mock to retrieve. Can be omitted as it's inferred
|
|
2307 from the object instance passed in as the <paramref name="mocked"/> instance.
|
|
2308 </typeparam><param name="mocked">The instance of the mocked object.</param><returns>The mock associated with the mocked object.</returns><exception cref="T:System.ArgumentException">
|
|
2309 The received <paramref name="mocked"/> instance
|
|
2310 was not created by Moq.
|
|
2311 </exception><example group="advanced">
|
|
2312 The following example shows how to add a new setup to an object
|
|
2313 instance which is not the original <see cref="T:Moq.Mock`1"/> but rather
|
|
2314 the object associated with it:
|
|
2315 <code>
|
|
2316 // Typed instance, not the mock, is retrieved from some test API.
|
|
2317 HttpContextBase context = GetMockContext();
|
|
2318
|
|
2319 // context.Request is the typed object from the "real" API
|
|
2320 // so in order to add a setup to it, we need to get
|
|
2321 // the mock that "owns" it
|
|
2322 Mock<HttpRequestBase> request = Mock.Get(context.Request);
|
|
2323 mock.Setup(req => req.AppRelativeCurrentExecutionFilePath)
|
|
2324 .Returns(tempUrl);
|
|
2325 </code>
|
|
2326 </example>
|
|
2327 </member>
|
|
2328 <member name="M:Moq.Mock.OnGetObject">
|
|
2329 <summary>
|
|
2330 Returns the mocked object value.
|
|
2331 </summary>
|
|
2332 </member>
|
|
2333 <member name="M:Moq.Mock.Verify">
|
|
2334 <summary>
|
|
2335 Verifies that all verifiable expectations have been met.
|
|
2336 </summary><example group="verification">
|
|
2337 This example sets up an expectation and marks it as verifiable. After
|
|
2338 the mock is used, a <c>Verify()</c> call is issued on the mock
|
|
2339 to ensure the method in the setup was invoked:
|
|
2340 <code>
|
|
2341 var mock = new Mock<IWarehouse>();
|
|
2342 this.Setup(x => x.HasInventory(TALISKER, 50)).Verifiable().Returns(true);
|
|
2343 ...
|
|
2344 // other test code
|
|
2345 ...
|
|
2346 // Will throw if the test code has didn't call HasInventory.
|
|
2347 this.Verify();
|
|
2348 </code>
|
|
2349 </example><exception cref="T:Moq.MockException">Not all verifiable expectations were met.</exception>
|
|
2350 </member>
|
|
2351 <member name="M:Moq.Mock.VerifyAll">
|
|
2352 <summary>
|
|
2353 Verifies all expectations regardless of whether they have
|
|
2354 been flagged as verifiable.
|
|
2355 </summary><example group="verification">
|
|
2356 This example sets up an expectation without marking it as verifiable. After
|
|
2357 the mock is used, a <see cref="M:Moq.Mock.VerifyAll"/> call is issued on the mock
|
|
2358 to ensure that all expectations are met:
|
|
2359 <code>
|
|
2360 var mock = new Mock<IWarehouse>();
|
|
2361 this.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
|
|
2362 ...
|
|
2363 // other test code
|
|
2364 ...
|
|
2365 // Will throw if the test code has didn't call HasInventory, even
|
|
2366 // that expectation was not marked as verifiable.
|
|
2367 this.VerifyAll();
|
|
2368 </code>
|
|
2369 </example><exception cref="T:Moq.MockException">At least one expectation was not met.</exception>
|
|
2370 </member>
|
|
2371 <member name="M:Moq.Mock.GetInterceptor(System.Linq.Expressions.Expression,Moq.Mock)">
|
|
2372 <summary>
|
|
2373 Gets the interceptor target for the given expression and root mock,
|
|
2374 building the intermediate hierarchy of mock objects if necessary.
|
|
2375 </summary>
|
|
2376 </member>
|
|
2377 <member name="M:Moq.Mock.DoRaise(System.Reflection.EventInfo,System.EventArgs)">
|
|
2378 <summary>
|
|
2379 Raises the associated event with the given
|
|
2380 event argument data.
|
|
2381 </summary>
|
|
2382 </member>
|
|
2383 <member name="M:Moq.Mock.DoRaise(System.Reflection.EventInfo,System.Object[])">
|
|
2384 <summary>
|
|
2385 Raises the associated event with the given
|
|
2386 event argument data.
|
|
2387 </summary>
|
|
2388 </member>
|
|
2389 <member name="M:Moq.Mock.As``1">
|
|
2390 <summary>
|
|
2391 Adds an interface implementation to the mock,
|
|
2392 allowing setups to be specified for it.
|
|
2393 </summary><remarks>
|
|
2394 This method can only be called before the first use
|
|
2395 of the mock <see cref="P:Moq.Mock.Object"/> property, at which
|
|
2396 point the runtime type has already been generated
|
|
2397 and no more interfaces can be added to it.
|
|
2398 <para>
|
|
2399 Also, <typeparamref name="TInterface"/> must be an
|
|
2400 interface and not a class, which must be specified
|
|
2401 when creating the mock instead.
|
|
2402 </para>
|
|
2403 </remarks><exception cref="T:System.InvalidOperationException">
|
|
2404 The mock type
|
|
2405 has already been generated by accessing the <see cref="P:Moq.Mock.Object"/> property.
|
|
2406 </exception><exception cref="T:System.ArgumentException">
|
|
2407 The <typeparamref name="TInterface"/> specified
|
|
2408 is not an interface.
|
|
2409 </exception><example>
|
|
2410 The following example creates a mock for the main interface
|
|
2411 and later adds <see cref="T:System.IDisposable"/> to it to verify
|
|
2412 it's called by the consumer code:
|
|
2413 <code>
|
|
2414 var mock = new Mock<IProcessor>();
|
|
2415 mock.Setup(x => x.Execute("ping"));
|
|
2416
|
|
2417 // add IDisposable interface
|
|
2418 var disposable = mock.As<IDisposable>();
|
|
2419 disposable.Setup(d => d.Dispose()).Verifiable();
|
|
2420 </code>
|
|
2421 </example><typeparam name="TInterface">Type of interface to cast the mock to.</typeparam>
|
|
2422 </member>
|
|
2423 <member name="M:Moq.Mock.SetReturnsDefault``1(``0)">
|
|
2424 <!-- No matching elements were found for the following include tag --><include file="Mock.Generic.xdoc" path="docs/doc[@for="Mock.SetReturnDefault{TReturn}"]/*"/>
|
|
2425 </member>
|
|
2426 <member name="P:Moq.Mock.Behavior">
|
|
2427 <summary>
|
|
2428 Behavior of the mock, according to the value set in the constructor.
|
|
2429 </summary>
|
|
2430 </member>
|
|
2431 <member name="P:Moq.Mock.CallBase">
|
|
2432 <summary>
|
|
2433 Whether the base member virtual implementation will be called
|
|
2434 for mocked classes if no setup is matched. Defaults to <see langword="false"/>.
|
|
2435 </summary>
|
|
2436 </member>
|
|
2437 <member name="P:Moq.Mock.DefaultValue">
|
|
2438 <summary>
|
|
2439 Specifies the behavior to use when returning default values for
|
|
2440 unexpected invocations on loose mocks.
|
|
2441 </summary>
|
|
2442 </member>
|
|
2443 <member name="P:Moq.Mock.Object">
|
|
2444 <summary>
|
|
2445 Gets the mocked object instance.
|
|
2446 </summary>
|
|
2447 </member>
|
|
2448 <member name="P:Moq.Mock.MockedType">
|
|
2449 <summary>
|
|
2450 Retrieves the type of the mocked object, its generic type argument.
|
|
2451 This is used in the auto-mocking of hierarchy access.
|
|
2452 </summary>
|
|
2453 </member>
|
|
2454 <member name="P:Moq.Mock.DelegateInterfaceMethod">
|
|
2455 <summary>
|
|
2456 If this is a mock of a delegate, this property contains the method
|
|
2457 on the autogenerated interface so that we can convert setup + verify
|
|
2458 expressions on the delegate into expressions on the interface proxy.
|
|
2459 </summary>
|
|
2460 </member>
|
|
2461 <member name="P:Moq.Mock.IsDelegateMock">
|
|
2462 <summary>
|
|
2463 Allows to check whether expression conversion to the <see cref="P:Moq.Mock.DelegateInterfaceMethod"/>
|
|
2464 must be performed on the mock, without causing unnecessarily early initialization of
|
|
2465 the mock instance, which breaks As{T}.
|
|
2466 </summary>
|
|
2467 </member>
|
|
2468 <member name="P:Moq.Mock.DefaultValueProvider">
|
|
2469 <summary>
|
|
2470 Specifies the class that will determine the default
|
|
2471 value to return when invocations are made that
|
|
2472 have no setups and need to return a default
|
|
2473 value (for loose mocks).
|
|
2474 </summary>
|
|
2475 </member>
|
|
2476 <member name="P:Moq.Mock.ImplementedInterfaces">
|
|
2477 <summary>
|
|
2478 Exposes the list of extra interfaces implemented by the mock.
|
|
2479 </summary>
|
|
2480 </member>
|
|
2481 <member name="T:Moq.MockRepository">
|
|
2482 <summary>
|
|
2483 Utility repository class to use to construct multiple
|
|
2484 mocks when consistent verification is
|
|
2485 desired for all of them.
|
|
2486 </summary>
|
|
2487 <remarks>
|
|
2488 If multiple mocks will be created during a test, passing
|
|
2489 the desired <see cref="T:Moq.MockBehavior"/> (if different than the
|
|
2490 <see cref="F:Moq.MockBehavior.Default"/> or the one
|
|
2491 passed to the repository constructor) and later verifying each
|
|
2492 mock can become repetitive and tedious.
|
|
2493 <para>
|
|
2494 This repository class helps in that scenario by providing a
|
|
2495 simplified creation of multiple mocks with a default
|
|
2496 <see cref="T:Moq.MockBehavior"/> (unless overriden by calling
|
|
2497 <see cref="M:Moq.MockFactory.Create``1(Moq.MockBehavior)"/>) and posterior verification.
|
|
2498 </para>
|
|
2499 </remarks>
|
|
2500 <example group="repository">
|
|
2501 The following is a straightforward example on how to
|
|
2502 create and automatically verify strict mocks using a <see cref="T:Moq.MockRepository"/>:
|
|
2503 <code>
|
|
2504 var repository = new MockRepository(MockBehavior.Strict);
|
|
2505
|
|
2506 var foo = repository.Create<IFoo>();
|
|
2507 var bar = repository.Create<IBar>();
|
|
2508
|
|
2509 // no need to call Verifiable() on the setup
|
|
2510 // as we'll be validating all of them anyway.
|
|
2511 foo.Setup(f => f.Do());
|
|
2512 bar.Setup(b => b.Redo());
|
|
2513
|
|
2514 // exercise the mocks here
|
|
2515
|
|
2516 repository.VerifyAll();
|
|
2517 // At this point all setups are already checked
|
|
2518 // and an optional MockException might be thrown.
|
|
2519 // Note also that because the mocks are strict, any invocation
|
|
2520 // that doesn't have a matching setup will also throw a MockException.
|
|
2521 </code>
|
|
2522 The following examples shows how to setup the repository
|
|
2523 to create loose mocks and later verify only verifiable setups:
|
|
2524 <code>
|
|
2525 var repository = new MockRepository(MockBehavior.Loose);
|
|
2526
|
|
2527 var foo = repository.Create<IFoo>();
|
|
2528 var bar = repository.Create<IBar>();
|
|
2529
|
|
2530 // this setup will be verified when we verify the repository
|
|
2531 foo.Setup(f => f.Do()).Verifiable();
|
|
2532
|
|
2533 // this setup will NOT be verified
|
|
2534 foo.Setup(f => f.Calculate());
|
|
2535
|
|
2536 // this setup will be verified when we verify the repository
|
|
2537 bar.Setup(b => b.Redo()).Verifiable();
|
|
2538
|
|
2539 // exercise the mocks here
|
|
2540 // note that because the mocks are Loose, members
|
|
2541 // called in the interfaces for which no matching
|
|
2542 // setups exist will NOT throw exceptions,
|
|
2543 // and will rather return default values.
|
|
2544
|
|
2545 repository.Verify();
|
|
2546 // At this point verifiable setups are already checked
|
|
2547 // and an optional MockException might be thrown.
|
|
2548 </code>
|
|
2549 The following examples shows how to setup the repository with a
|
|
2550 default strict behavior, overriding that default for a
|
|
2551 specific mock:
|
|
2552 <code>
|
|
2553 var repository = new MockRepository(MockBehavior.Strict);
|
|
2554
|
|
2555 // this particular one we want loose
|
|
2556 var foo = repository.Create<IFoo>(MockBehavior.Loose);
|
|
2557 var bar = repository.Create<IBar>();
|
|
2558
|
|
2559 // specify setups
|
|
2560
|
|
2561 // exercise the mocks here
|
|
2562
|
|
2563 repository.Verify();
|
|
2564 </code>
|
|
2565 </example>
|
|
2566 <seealso cref="T:Moq.MockBehavior"/>
|
|
2567 </member>
|
|
2568 <member name="T:Moq.MockFactory">
|
|
2569 <summary>
|
|
2570 Utility factory class to use to construct multiple
|
|
2571 mocks when consistent verification is
|
|
2572 desired for all of them.
|
|
2573 </summary>
|
|
2574 <remarks>
|
|
2575 If multiple mocks will be created during a test, passing
|
|
2576 the desired <see cref="T:Moq.MockBehavior"/> (if different than the
|
|
2577 <see cref="F:Moq.MockBehavior.Default"/> or the one
|
|
2578 passed to the factory constructor) and later verifying each
|
|
2579 mock can become repetitive and tedious.
|
|
2580 <para>
|
|
2581 This factory class helps in that scenario by providing a
|
|
2582 simplified creation of multiple mocks with a default
|
|
2583 <see cref="T:Moq.MockBehavior"/> (unless overriden by calling
|
|
2584 <see cref="M:Moq.MockFactory.Create``1(Moq.MockBehavior)"/>) and posterior verification.
|
|
2585 </para>
|
|
2586 </remarks>
|
|
2587 <example group="factory">
|
|
2588 The following is a straightforward example on how to
|
|
2589 create and automatically verify strict mocks using a <see cref="T:Moq.MockFactory"/>:
|
|
2590 <code>
|
|
2591 var factory = new MockFactory(MockBehavior.Strict);
|
|
2592
|
|
2593 var foo = factory.Create<IFoo>();
|
|
2594 var bar = factory.Create<IBar>();
|
|
2595
|
|
2596 // no need to call Verifiable() on the setup
|
|
2597 // as we'll be validating all of them anyway.
|
|
2598 foo.Setup(f => f.Do());
|
|
2599 bar.Setup(b => b.Redo());
|
|
2600
|
|
2601 // exercise the mocks here
|
|
2602
|
|
2603 factory.VerifyAll();
|
|
2604 // At this point all setups are already checked
|
|
2605 // and an optional MockException might be thrown.
|
|
2606 // Note also that because the mocks are strict, any invocation
|
|
2607 // that doesn't have a matching setup will also throw a MockException.
|
|
2608 </code>
|
|
2609 The following examples shows how to setup the factory
|
|
2610 to create loose mocks and later verify only verifiable setups:
|
|
2611 <code>
|
|
2612 var factory = new MockFactory(MockBehavior.Loose);
|
|
2613
|
|
2614 var foo = factory.Create<IFoo>();
|
|
2615 var bar = factory.Create<IBar>();
|
|
2616
|
|
2617 // this setup will be verified when we verify the factory
|
|
2618 foo.Setup(f => f.Do()).Verifiable();
|
|
2619
|
|
2620 // this setup will NOT be verified
|
|
2621 foo.Setup(f => f.Calculate());
|
|
2622
|
|
2623 // this setup will be verified when we verify the factory
|
|
2624 bar.Setup(b => b.Redo()).Verifiable();
|
|
2625
|
|
2626 // exercise the mocks here
|
|
2627 // note that because the mocks are Loose, members
|
|
2628 // called in the interfaces for which no matching
|
|
2629 // setups exist will NOT throw exceptions,
|
|
2630 // and will rather return default values.
|
|
2631
|
|
2632 factory.Verify();
|
|
2633 // At this point verifiable setups are already checked
|
|
2634 // and an optional MockException might be thrown.
|
|
2635 </code>
|
|
2636 The following examples shows how to setup the factory with a
|
|
2637 default strict behavior, overriding that default for a
|
|
2638 specific mock:
|
|
2639 <code>
|
|
2640 var factory = new MockFactory(MockBehavior.Strict);
|
|
2641
|
|
2642 // this particular one we want loose
|
|
2643 var foo = factory.Create<IFoo>(MockBehavior.Loose);
|
|
2644 var bar = factory.Create<IBar>();
|
|
2645
|
|
2646 // specify setups
|
|
2647
|
|
2648 // exercise the mocks here
|
|
2649
|
|
2650 factory.Verify();
|
|
2651 </code>
|
|
2652 </example>
|
|
2653 <seealso cref="T:Moq.MockBehavior"/>
|
|
2654 </member>
|
|
2655 <member name="M:Moq.MockFactory.#ctor(Moq.MockBehavior)">
|
|
2656 <summary>
|
|
2657 Initializes the factory with the given <paramref name="defaultBehavior"/>
|
|
2658 for newly created mocks from the factory.
|
|
2659 </summary>
|
|
2660 <param name="defaultBehavior">The behavior to use for mocks created
|
|
2661 using the <see cref="M:Moq.MockFactory.Create``1"/> factory method if not overriden
|
|
2662 by using the <see cref="M:Moq.MockFactory.Create``1(Moq.MockBehavior)"/> overload.</param>
|
|
2663 </member>
|
|
2664 <member name="M:Moq.MockFactory.Create``1">
|
|
2665 <summary>
|
|
2666 Creates a new mock with the default <see cref="T:Moq.MockBehavior"/>
|
|
2667 specified at factory construction time.
|
|
2668 </summary>
|
|
2669 <typeparam name="T">Type to mock.</typeparam>
|
|
2670 <returns>A new <see cref="T:Moq.Mock`1"/>.</returns>
|
|
2671 <example ignore="true">
|
|
2672 <code>
|
|
2673 var factory = new MockFactory(MockBehavior.Strict);
|
|
2674
|
|
2675 var foo = factory.Create<IFoo>();
|
|
2676 // use mock on tests
|
|
2677
|
|
2678 factory.VerifyAll();
|
|
2679 </code>
|
|
2680 </example>
|
|
2681 </member>
|
|
2682 <member name="M:Moq.MockFactory.Create``1(System.Object[])">
|
|
2683 <summary>
|
|
2684 Creates a new mock with the default <see cref="T:Moq.MockBehavior"/>
|
|
2685 specified at factory construction time and with the
|
|
2686 the given constructor arguments for the class.
|
|
2687 </summary>
|
|
2688 <remarks>
|
|
2689 The mock will try to find the best match constructor given the
|
|
2690 constructor arguments, and invoke that to initialize the instance.
|
|
2691 This applies only to classes, not interfaces.
|
|
2692 </remarks>
|
|
2693 <typeparam name="T">Type to mock.</typeparam>
|
|
2694 <param name="args">Constructor arguments for mocked classes.</param>
|
|
2695 <returns>A new <see cref="T:Moq.Mock`1"/>.</returns>
|
|
2696 <example ignore="true">
|
|
2697 <code>
|
|
2698 var factory = new MockFactory(MockBehavior.Default);
|
|
2699
|
|
2700 var mock = factory.Create<MyBase>("Foo", 25, true);
|
|
2701 // use mock on tests
|
|
2702
|
|
2703 factory.Verify();
|
|
2704 </code>
|
|
2705 </example>
|
|
2706 </member>
|
|
2707 <member name="M:Moq.MockFactory.Create``1(Moq.MockBehavior)">
|
|
2708 <summary>
|
|
2709 Creates a new mock with the given <paramref name="behavior"/>.
|
|
2710 </summary>
|
|
2711 <typeparam name="T">Type to mock.</typeparam>
|
|
2712 <param name="behavior">Behavior to use for the mock, which overrides
|
|
2713 the default behavior specified at factory construction time.</param>
|
|
2714 <returns>A new <see cref="T:Moq.Mock`1"/>.</returns>
|
|
2715 <example group="factory">
|
|
2716 The following example shows how to create a mock with a different
|
|
2717 behavior to that specified as the default for the factory:
|
|
2718 <code>
|
|
2719 var factory = new MockFactory(MockBehavior.Strict);
|
|
2720
|
|
2721 var foo = factory.Create<IFoo>(MockBehavior.Loose);
|
|
2722 </code>
|
|
2723 </example>
|
|
2724 </member>
|
|
2725 <member name="M:Moq.MockFactory.Create``1(Moq.MockBehavior,System.Object[])">
|
|
2726 <summary>
|
|
2727 Creates a new mock with the given <paramref name="behavior"/>
|
|
2728 and with the the given constructor arguments for the class.
|
|
2729 </summary>
|
|
2730 <remarks>
|
|
2731 The mock will try to find the best match constructor given the
|
|
2732 constructor arguments, and invoke that to initialize the instance.
|
|
2733 This applies only to classes, not interfaces.
|
|
2734 </remarks>
|
|
2735 <typeparam name="T">Type to mock.</typeparam>
|
|
2736 <param name="behavior">Behavior to use for the mock, which overrides
|
|
2737 the default behavior specified at factory construction time.</param>
|
|
2738 <param name="args">Constructor arguments for mocked classes.</param>
|
|
2739 <returns>A new <see cref="T:Moq.Mock`1"/>.</returns>
|
|
2740 <example group="factory">
|
|
2741 The following example shows how to create a mock with a different
|
|
2742 behavior to that specified as the default for the factory, passing
|
|
2743 constructor arguments:
|
|
2744 <code>
|
|
2745 var factory = new MockFactory(MockBehavior.Default);
|
|
2746
|
|
2747 var mock = factory.Create<MyBase>(MockBehavior.Strict, "Foo", 25, true);
|
|
2748 </code>
|
|
2749 </example>
|
|
2750 </member>
|
|
2751 <member name="M:Moq.MockFactory.CreateMock``1(Moq.MockBehavior,System.Object[])">
|
|
2752 <summary>
|
|
2753 Implements creation of a new mock within the factory.
|
|
2754 </summary>
|
|
2755 <typeparam name="T">Type to mock.</typeparam>
|
|
2756 <param name="behavior">The behavior for the new mock.</param>
|
|
2757 <param name="args">Optional arguments for the construction of the mock.</param>
|
|
2758 </member>
|
|
2759 <member name="M:Moq.MockFactory.Verify">
|
|
2760 <summary>
|
|
2761 Verifies all verifiable expectations on all mocks created
|
|
2762 by this factory.
|
|
2763 </summary>
|
|
2764 <seealso cref="M:Moq.Mock.Verify"/>
|
|
2765 <exception cref="T:Moq.MockException">One or more mocks had expectations that were not satisfied.</exception>
|
|
2766 </member>
|
|
2767 <member name="M:Moq.MockFactory.VerifyAll">
|
|
2768 <summary>
|
|
2769 Verifies all verifiable expectations on all mocks created
|
|
2770 by this factory.
|
|
2771 </summary>
|
|
2772 <seealso cref="M:Moq.Mock.Verify"/>
|
|
2773 <exception cref="T:Moq.MockException">One or more mocks had expectations that were not satisfied.</exception>
|
|
2774 </member>
|
|
2775 <member name="M:Moq.MockFactory.VerifyMocks(System.Action{Moq.Mock})">
|
|
2776 <summary>
|
|
2777 Invokes <paramref name="verifyAction"/> for each mock
|
|
2778 in <see cref="P:Moq.MockFactory.Mocks"/>, and accumulates the resulting
|
|
2779 <see cref="T:Moq.MockVerificationException"/> that might be
|
|
2780 thrown from the action.
|
|
2781 </summary>
|
|
2782 <param name="verifyAction">The action to execute against
|
|
2783 each mock.</param>
|
|
2784 </member>
|
|
2785 <member name="P:Moq.MockFactory.CallBase">
|
|
2786 <summary>
|
|
2787 Whether the base member virtual implementation will be called
|
|
2788 for mocked classes if no setup is matched. Defaults to <see langword="false"/>.
|
|
2789 </summary>
|
|
2790 </member>
|
|
2791 <member name="P:Moq.MockFactory.DefaultValue">
|
|
2792 <summary>
|
|
2793 Specifies the behavior to use when returning default values for
|
|
2794 unexpected invocations on loose mocks.
|
|
2795 </summary>
|
|
2796 </member>
|
|
2797 <member name="P:Moq.MockFactory.Mocks">
|
|
2798 <summary>
|
|
2799 Gets the mocks that have been created by this factory and
|
|
2800 that will get verified together.
|
|
2801 </summary>
|
|
2802 </member>
|
|
2803 <member name="M:Moq.MockRepository.Of``1">
|
|
2804 <summary>
|
|
2805 Access the universe of mocks of the given type, to retrieve those
|
|
2806 that behave according to the LINQ query specification.
|
|
2807 </summary>
|
|
2808 <typeparam name="T">The type of the mocked object to query.</typeparam>
|
|
2809 </member>
|
|
2810 <member name="M:Moq.MockRepository.Of``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
|
2811 <summary>
|
|
2812 Access the universe of mocks of the given type, to retrieve those
|
|
2813 that behave according to the LINQ query specification.
|
|
2814 </summary>
|
|
2815 <param name="specification">The predicate with the setup expressions.</param>
|
|
2816 <typeparam name="T">The type of the mocked object to query.</typeparam>
|
|
2817 </member>
|
|
2818 <member name="M:Moq.MockRepository.OneOf``1">
|
|
2819 <summary>
|
|
2820 Creates an mock object of the indicated type.
|
|
2821 </summary>
|
|
2822 <typeparam name="T">The type of the mocked object.</typeparam>
|
|
2823 <returns>The mocked object created.</returns>
|
|
2824 </member>
|
|
2825 <member name="M:Moq.MockRepository.OneOf``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
|
2826 <summary>
|
|
2827 Creates an mock object of the indicated type.
|
|
2828 </summary>
|
|
2829 <param name="specification">The predicate with the setup expressions.</param>
|
|
2830 <typeparam name="T">The type of the mocked object.</typeparam>
|
|
2831 <returns>The mocked object created.</returns>
|
|
2832 </member>
|
|
2833 <member name="M:Moq.MockRepository.CreateMockQuery``1">
|
|
2834 <summary>
|
|
2835 Creates the mock query with the underlying queriable implementation.
|
|
2836 </summary>
|
|
2837 </member>
|
|
2838 <member name="M:Moq.MockRepository.CreateQueryable``1">
|
|
2839 <summary>
|
|
2840 Wraps the enumerator inside a queryable.
|
|
2841 </summary>
|
|
2842 </member>
|
|
2843 <member name="M:Moq.MockRepository.CreateMocks``1">
|
|
2844 <summary>
|
|
2845 Method that is turned into the actual call from .Query{T}, to
|
|
2846 transform the queryable query into a normal enumerable query.
|
|
2847 This method is never used directly by consumers.
|
|
2848 </summary>
|
|
2849 </member>
|
|
2850 <member name="M:Moq.MockRepository.#ctor(Moq.MockBehavior)">
|
|
2851 <summary>
|
|
2852 Initializes the repository with the given <paramref name="defaultBehavior"/>
|
|
2853 for newly created mocks from the repository.
|
|
2854 </summary>
|
|
2855 <param name="defaultBehavior">The behavior to use for mocks created
|
|
2856 using the <see cref="M:Moq.MockFactory.Create``1"/> repository method if not overriden
|
|
2857 by using the <see cref="M:Moq.MockFactory.Create``1(Moq.MockBehavior)"/> overload.</param>
|
|
2858 </member>
|
|
2859 <member name="T:Moq.EmptyDefaultValueProvider">
|
|
2860 <summary>
|
|
2861 A <see cref="T:Moq.IDefaultValueProvider"/> that returns an empty default value
|
|
2862 for invocations that do not have setups or return values, with loose mocks.
|
|
2863 This is the default behavior for a mock.
|
|
2864 </summary>
|
|
2865 </member>
|
|
2866 <member name="T:Moq.IDefaultValueProvider">
|
|
2867 <summary>
|
|
2868 Interface to be implemented by classes that determine the
|
|
2869 default value of non-expected invocations.
|
|
2870 </summary>
|
|
2871 </member>
|
|
2872 <member name="M:Moq.IDefaultValueProvider.DefineDefault``1(``0)">
|
|
2873 <summary>
|
|
2874 Defines the default value to return in all the methods returning <typeparamref name="T"/>.
|
|
2875 </summary><typeparam name="T">The type of the return value.</typeparam><param name="value">The value to set as default.</param>
|
|
2876 </member>
|
|
2877 <member name="M:Moq.IDefaultValueProvider.ProvideDefault(System.Reflection.MethodInfo)">
|
|
2878 <summary>
|
|
2879 Provides a value for the given member and arguments.
|
|
2880 </summary><param name="member">
|
|
2881 The member to provide a default value for.
|
|
2882 </param>
|
|
2883 </member>
|
|
2884 <member name="T:Moq.ExpressionStringBuilder">
|
|
2885 <summary>
|
|
2886 The intention of <see cref="T:Moq.ExpressionStringBuilder"/> is to create a more readable
|
|
2887 string representation for the failure message.
|
|
2888 </summary>
|
|
2889 </member>
|
|
2890 <member name="T:Moq.Language.Flow.ICallbackResult">
|
|
2891 <summary>
|
|
2892 Implements the fluent API.
|
|
2893 </summary>
|
|
2894 </member>
|
|
2895 <member name="T:Moq.Language.IThrows">
|
|
2896 <summary>
|
|
2897 Defines the <c>Throws</c> verb.
|
|
2898 </summary>
|
|
2899 </member>
|
|
2900 <member name="M:Moq.Language.IThrows.Throws(System.Exception)">
|
|
2901 <summary>
|
|
2902 Specifies the exception to throw when the method is invoked.
|
|
2903 </summary>
|
|
2904 <param name="exception">Exception instance to throw.</param>
|
|
2905 <example>
|
|
2906 This example shows how to throw an exception when the method is
|
|
2907 invoked with an empty string argument:
|
|
2908 <code>
|
|
2909 mock.Setup(x => x.Execute(""))
|
|
2910 .Throws(new ArgumentException());
|
|
2911 </code>
|
|
2912 </example>
|
|
2913 </member>
|
|
2914 <member name="M:Moq.Language.IThrows.Throws``1">
|
|
2915 <summary>
|
|
2916 Specifies the type of exception to throw when the method is invoked.
|
|
2917 </summary>
|
|
2918 <typeparam name="TException">Type of exception to instantiate and throw when the setup is matched.</typeparam>
|
|
2919 <example>
|
|
2920 This example shows how to throw an exception when the method is
|
|
2921 invoked with an empty string argument:
|
|
2922 <code>
|
|
2923 mock.Setup(x => x.Execute(""))
|
|
2924 .Throws<ArgumentException>();
|
|
2925 </code>
|
|
2926 </example>
|
|
2927 </member>
|
|
2928 <member name="T:Moq.Language.Flow.IThrowsResult">
|
|
2929 <summary>
|
|
2930 Implements the fluent API.
|
|
2931 </summary>
|
|
2932 </member>
|
|
2933 <member name="T:Moq.Language.IOccurrence">
|
|
2934 <summary>
|
|
2935 Defines occurrence members to constraint setups.
|
|
2936 </summary>
|
|
2937 </member>
|
|
2938 <member name="M:Moq.Language.IOccurrence.AtMostOnce">
|
|
2939 <summary>
|
|
2940 The expected invocation can happen at most once.
|
|
2941 </summary>
|
|
2942 <example>
|
|
2943 <code>
|
|
2944 var mock = new Mock<ICommand>();
|
|
2945 mock.Setup(foo => foo.Execute("ping"))
|
|
2946 .AtMostOnce();
|
|
2947 </code>
|
|
2948 </example>
|
|
2949 </member>
|
|
2950 <member name="M:Moq.Language.IOccurrence.AtMost(System.Int32)">
|
|
2951 <summary>
|
|
2952 The expected invocation can happen at most specified number of times.
|
|
2953 </summary>
|
|
2954 <param name="callCount">The number of times to accept calls.</param>
|
|
2955 <example>
|
|
2956 <code>
|
|
2957 var mock = new Mock<ICommand>();
|
|
2958 mock.Setup(foo => foo.Execute("ping"))
|
|
2959 .AtMost( 5 );
|
|
2960 </code>
|
|
2961 </example>
|
|
2962 </member>
|
|
2963 <member name="T:Moq.Language.IVerifies">
|
|
2964 <summary>
|
|
2965 Defines the <c>Verifiable</c> verb.
|
|
2966 </summary>
|
|
2967 </member>
|
|
2968 <member name="M:Moq.Language.IVerifies.Verifiable">
|
|
2969 <summary>
|
|
2970 Marks the expectation as verifiable, meaning that a call
|
|
2971 to <see cref="M:Moq.Mock.Verify"/> will check if this particular
|
|
2972 expectation was met.
|
|
2973 </summary>
|
|
2974 <example>
|
|
2975 The following example marks the expectation as verifiable:
|
|
2976 <code>
|
|
2977 mock.Expect(x => x.Execute("ping"))
|
|
2978 .Returns(true)
|
|
2979 .Verifiable();
|
|
2980 </code>
|
|
2981 </example>
|
|
2982 </member>
|
|
2983 <member name="M:Moq.Language.IVerifies.Verifiable(System.String)">
|
|
2984 <summary>
|
|
2985 Marks the expectation as verifiable, meaning that a call
|
|
2986 to <see cref="M:Moq.Mock.Verify"/> will check if this particular
|
|
2987 expectation was met, and specifies a message for failures.
|
|
2988 </summary>
|
|
2989 <example>
|
|
2990 The following example marks the expectation as verifiable:
|
|
2991 <code>
|
|
2992 mock.Expect(x => x.Execute("ping"))
|
|
2993 .Returns(true)
|
|
2994 .Verifiable("Ping should be executed always!");
|
|
2995 </code>
|
|
2996 </example>
|
|
2997 </member>
|
|
2998 <member name="T:Moq.Language.Flow.ISetup`1">
|
|
2999 <summary>
|
|
3000 Implements the fluent API.
|
|
3001 </summary>
|
|
3002 </member>
|
|
3003 <member name="T:Moq.MethodCallReturn">
|
|
3004 <devdoc>
|
|
3005 We need this non-generics base class so that
|
|
3006 we can use <see cref="P:Moq.MethodCallReturn.HasReturnValue"/> from
|
|
3007 generic code.
|
|
3008 </devdoc>
|
|
3009 </member>
|
|
3010 <member name="T:Moq.Language.Flow.ISetup`2">
|
|
3011 <summary>
|
|
3012 Implements the fluent API.
|
|
3013 </summary>
|
|
3014 </member>
|
|
3015 <member name="T:Moq.Language.Flow.IReturnsThrows`2">
|
|
3016 <summary>
|
|
3017 Implements the fluent API.
|
|
3018 </summary>
|
|
3019 </member>
|
|
3020 <member name="T:Moq.Language.Flow.ISetupGetter`2">
|
|
3021 <summary>
|
|
3022 Implements the fluent API.
|
|
3023 </summary>
|
|
3024 </member>
|
|
3025 <member name="T:Moq.Language.ICallbackGetter`2">
|
|
3026 <summary>
|
|
3027 Defines the <c>Callback</c> verb for property getter setups.
|
|
3028 </summary>
|
|
3029 <seealso cref="M:Moq.Mock`1.SetupGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})"/>
|
|
3030 <typeparam name="TMock">Mocked type.</typeparam>
|
|
3031 <typeparam name="TProperty">Type of the property.</typeparam>
|
|
3032 </member>
|
|
3033 <member name="M:Moq.Language.ICallbackGetter`2.Callback(System.Action)">
|
|
3034 <summary>
|
|
3035 Specifies a callback to invoke when the property is retrieved.
|
|
3036 </summary>
|
|
3037 <param name="action">Callback method to invoke.</param>
|
|
3038 <example>
|
|
3039 Invokes the given callback with the property value being set.
|
|
3040 <code>
|
|
3041 mock.SetupGet(x => x.Suspended)
|
|
3042 .Callback(() => called = true)
|
|
3043 .Returns(true);
|
|
3044 </code>
|
|
3045 </example>
|
|
3046 </member>
|
|
3047 <member name="T:Moq.Language.Flow.IReturnsThrowsGetter`2">
|
|
3048 <summary>
|
|
3049 Implements the fluent API.
|
|
3050 </summary>
|
|
3051 </member>
|
|
3052 <member name="T:Moq.Language.IReturnsGetter`2">
|
|
3053 <summary>
|
|
3054 Defines the <c>Returns</c> verb for property get setups.
|
|
3055 </summary>
|
|
3056 <typeparam name="TMock">Mocked type.</typeparam>
|
|
3057 <typeparam name="TProperty">Type of the property.</typeparam>
|
|
3058 </member>
|
|
3059 <member name="M:Moq.Language.IReturnsGetter`2.Returns(`1)">
|
|
3060 <summary>
|
|
3061 Specifies the value to return.
|
|
3062 </summary>
|
|
3063 <param name="value">The value to return, or <see langword="null"/>.</param>
|
|
3064 <example>
|
|
3065 Return a <c>true</c> value from the property getter call:
|
|
3066 <code>
|
|
3067 mock.SetupGet(x => x.Suspended)
|
|
3068 .Returns(true);
|
|
3069 </code>
|
|
3070 </example>
|
|
3071 </member>
|
|
3072 <member name="M:Moq.Language.IReturnsGetter`2.Returns(System.Func{`1})">
|
|
3073 <summary>
|
|
3074 Specifies a function that will calculate the value to return for the property.
|
|
3075 </summary>
|
|
3076 <param name="valueFunction">The function that will calculate the return value.</param>
|
|
3077 <example>
|
|
3078 Return a calculated value when the property is retrieved:
|
|
3079 <code>
|
|
3080 mock.SetupGet(x => x.Suspended)
|
|
3081 .Returns(() => returnValues[0]);
|
|
3082 </code>
|
|
3083 The lambda expression to retrieve the return value is lazy-executed,
|
|
3084 meaning that its value may change depending on the moment the property
|
|
3085 is retrieved and the value the <c>returnValues</c> array has at
|
|
3086 that moment.
|
|
3087 </example>
|
|
3088 </member>
|
|
3089 <member name="M:Moq.Language.IReturnsGetter`2.CallBase">
|
|
3090 <summary>
|
|
3091 Calls the real property of the object and returns its return value.
|
|
3092 </summary>
|
|
3093 <returns>The value calculated by the real property of the object.</returns>
|
|
3094 </member>
|
|
3095 <member name="T:Moq.Language.Flow.IReturnsResult`1">
|
|
3096 <summary>
|
|
3097 Implements the fluent API.
|
|
3098 </summary>
|
|
3099 </member>
|
|
3100 <member name="T:Moq.MockExtensions">
|
|
3101 <summary>
|
|
3102 Provides additional methods on mocks.
|
|
3103 </summary>
|
|
3104 <remarks>
|
|
3105 Those methods are useful for Testeroids support.
|
|
3106 </remarks>
|
|
3107 </member>
|
|
3108 <member name="M:Moq.MockExtensions.ResetCalls(Moq.Mock)">
|
|
3109 <summary>
|
|
3110 Resets the calls previously made on the specified mock.
|
|
3111 </summary>
|
|
3112 <param name="mock">The mock whose calls need to be reset.</param>
|
|
3113 </member>
|
|
3114 <member name="T:Moq.MockSequence">
|
|
3115 <summary>
|
|
3116 Helper class to setup a full trace between many mocks
|
|
3117 </summary>
|
|
3118 </member>
|
|
3119 <member name="M:Moq.MockSequence.#ctor">
|
|
3120 <summary>
|
|
3121 Initialize a trace setup
|
|
3122 </summary>
|
|
3123 </member>
|
|
3124 <member name="P:Moq.MockSequence.Cyclic">
|
|
3125 <summary>
|
|
3126 Allow sequence to be repeated
|
|
3127 </summary>
|
|
3128 </member>
|
|
3129 <member name="T:Moq.MockSequenceHelper">
|
|
3130 <summary>
|
|
3131 define nice api
|
|
3132 </summary>
|
|
3133 </member>
|
|
3134 <member name="M:Moq.MockSequenceHelper.InSequence``1(Moq.Mock{``0},Moq.MockSequence)">
|
|
3135 <summary>
|
|
3136 Perform an expectation in the trace.
|
|
3137 </summary>
|
|
3138 </member>
|
|
3139 <member name="T:Moq.MatcherAttribute">
|
|
3140 <summary>
|
|
3141 Marks a method as a matcher, which allows complete replacement
|
|
3142 of the built-in <see cref="T:Moq.It"/> class with your own argument
|
|
3143 matching rules.
|
|
3144 </summary>
|
|
3145 <remarks>
|
|
3146 <b>This feature has been deprecated in favor of the new
|
|
3147 and simpler <see cref="T:Moq.Match`1"/>.
|
|
3148 </b>
|
|
3149 <para>
|
|
3150 The argument matching is used to determine whether a concrete
|
|
3151 invocation in the mock matches a given setup. This
|
|
3152 matching mechanism is fully extensible.
|
|
3153 </para>
|
|
3154 <para>
|
|
3155 There are two parts of a matcher: the compiler matcher
|
|
3156 and the runtime matcher.
|
|
3157 <list type="bullet">
|
|
3158 <item>
|
|
3159 <term>Compiler matcher</term>
|
|
3160 <description>Used to satisfy the compiler requirements for the
|
|
3161 argument. Needs to be a method optionally receiving any arguments
|
|
3162 you might need for the matching, but with a return type that
|
|
3163 matches that of the argument.
|
|
3164 <para>
|
|
3165 Let's say I want to match a lists of orders that contains
|
|
3166 a particular one. I might create a compiler matcher like the following:
|
|
3167 </para>
|
|
3168 <code>
|
|
3169 public static class Orders
|
|
3170 {
|
|
3171 [Matcher]
|
|
3172 public static IEnumerable<Order> Contains(Order order)
|
|
3173 {
|
|
3174 return null;
|
|
3175 }
|
|
3176 }
|
|
3177 </code>
|
|
3178 Now we can invoke this static method instead of an argument in an
|
|
3179 invocation:
|
|
3180 <code>
|
|
3181 var order = new Order { ... };
|
|
3182 var mock = new Mock<IRepository<Order>>();
|
|
3183
|
|
3184 mock.Setup(x => x.Save(Orders.Contains(order)))
|
|
3185 .Throws<ArgumentException>();
|
|
3186 </code>
|
|
3187 Note that the return value from the compiler matcher is irrelevant.
|
|
3188 This method will never be called, and is just used to satisfy the
|
|
3189 compiler and to signal Moq that this is not a method that we want
|
|
3190 to be invoked at runtime.
|
|
3191 </description>
|
|
3192 </item>
|
|
3193 <item>
|
|
3194 <term>Runtime matcher</term>
|
|
3195 <description>
|
|
3196 The runtime matcher is the one that will actually perform evaluation
|
|
3197 when the test is run, and is defined by convention to have the
|
|
3198 same signature as the compiler matcher, but where the return
|
|
3199 value is the first argument to the call, which contains the
|
|
3200 object received by the actual invocation at runtime:
|
|
3201 <code>
|
|
3202 public static bool Contains(IEnumerable<Order> orders, Order order)
|
|
3203 {
|
|
3204 return orders.Contains(order);
|
|
3205 }
|
|
3206 </code>
|
|
3207 At runtime, the mocked method will be invoked with a specific
|
|
3208 list of orders. This value will be passed to this runtime
|
|
3209 matcher as the first argument, while the second argument is the
|
|
3210 one specified in the setup (<c>x.Save(Orders.Contains(order))</c>).
|
|
3211 <para>
|
|
3212 The boolean returned determines whether the given argument has been
|
|
3213 matched. If all arguments to the expected method are matched, then
|
|
3214 the setup matches and is evaluated.
|
|
3215 </para>
|
|
3216 </description>
|
|
3217 </item>
|
|
3218 </list>
|
|
3219 </para>
|
|
3220 Using this extensible infrastructure, you can easily replace the entire
|
|
3221 <see cref="T:Moq.It"/> set of matchers with your own. You can also avoid the
|
|
3222 typical (and annoying) lengthy expressions that result when you have
|
|
3223 multiple arguments that use generics.
|
|
3224 </remarks>
|
|
3225 <example>
|
|
3226 The following is the complete example explained above:
|
|
3227 <code>
|
|
3228 public static class Orders
|
|
3229 {
|
|
3230 [Matcher]
|
|
3231 public static IEnumerable<Order> Contains(Order order)
|
|
3232 {
|
|
3233 return null;
|
|
3234 }
|
|
3235
|
|
3236 public static bool Contains(IEnumerable<Order> orders, Order order)
|
|
3237 {
|
|
3238 return orders.Contains(order);
|
|
3239 }
|
|
3240 }
|
|
3241 </code>
|
|
3242 And the concrete test using this matcher:
|
|
3243 <code>
|
|
3244 var order = new Order { ... };
|
|
3245 var mock = new Mock<IRepository<Order>>();
|
|
3246
|
|
3247 mock.Setup(x => x.Save(Orders.Contains(order)))
|
|
3248 .Throws<ArgumentException>();
|
|
3249
|
|
3250 // use mock, invoke Save, and have the matcher filter.
|
|
3251 </code>
|
|
3252 </example>
|
|
3253 </member>
|
|
3254 <member name="T:Moq.Mock`1">
|
|
3255 <summary>
|
|
3256 Provides a mock implementation of <typeparamref name="T"/>.
|
|
3257 </summary><remarks>
|
|
3258 Any interface type can be used for mocking, but for classes, only abstract and virtual members can be mocked.
|
|
3259 <para>
|
|
3260 The behavior of the mock with regards to the setups and the actual calls is determined
|
|
3261 by the optional <see cref="T:Moq.MockBehavior"/> that can be passed to the <see cref="M:Moq.Mock`1.#ctor(Moq.MockBehavior)"/>
|
|
3262 constructor.
|
|
3263 </para>
|
|
3264 </remarks><typeparam name="T">Type to mock, which can be an interface or a class.</typeparam><example group="overview" order="0">
|
|
3265 The following example shows establishing setups with specific values
|
|
3266 for method invocations:
|
|
3267 <code>
|
|
3268 // Arrange
|
|
3269 var order = new Order(TALISKER, 50);
|
|
3270 var mock = new Mock<IWarehouse>();
|
|
3271
|
|
3272 mock.Setup(x => x.HasInventory(TALISKER, 50)).Returns(true);
|
|
3273
|
|
3274 // Act
|
|
3275 order.Fill(mock.Object);
|
|
3276
|
|
3277 // Assert
|
|
3278 Assert.True(order.IsFilled);
|
|
3279 </code>
|
|
3280 The following example shows how to use the <see cref="T:Moq.It"/> class
|
|
3281 to specify conditions for arguments instead of specific values:
|
|
3282 <code>
|
|
3283 // Arrange
|
|
3284 var order = new Order(TALISKER, 50);
|
|
3285 var mock = new Mock<IWarehouse>();
|
|
3286
|
|
3287 // shows how to expect a value within a range
|
|
3288 mock.Setup(x => x.HasInventory(
|
|
3289 It.IsAny<string>(),
|
|
3290 It.IsInRange(0, 100, Range.Inclusive)))
|
|
3291 .Returns(false);
|
|
3292
|
|
3293 // shows how to throw for unexpected calls.
|
|
3294 mock.Setup(x => x.Remove(
|
|
3295 It.IsAny<string>(),
|
|
3296 It.IsAny<int>()))
|
|
3297 .Throws(new InvalidOperationException());
|
|
3298
|
|
3299 // Act
|
|
3300 order.Fill(mock.Object);
|
|
3301
|
|
3302 // Assert
|
|
3303 Assert.False(order.IsFilled);
|
|
3304 </code>
|
|
3305 </example>
|
|
3306 </member>
|
|
3307 <member name="M:Moq.Mock`1.Expect(System.Linq.Expressions.Expression{System.Action{`0}})">
|
|
3308 <summary>
|
|
3309 Obsolete.
|
|
3310 </summary>
|
|
3311 </member>
|
|
3312 <member name="M:Moq.Mock`1.Expect``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3313 <summary>
|
|
3314 Obsolete.
|
|
3315 </summary>
|
|
3316 </member>
|
|
3317 <member name="M:Moq.Mock`1.ExpectGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3318 <summary>
|
|
3319 Obsolete.
|
|
3320 </summary>
|
|
3321 </member>
|
|
3322 <member name="M:Moq.Mock`1.ExpectSet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3323 <summary>
|
|
3324 Obsolete.
|
|
3325 </summary>
|
|
3326 </member>
|
|
3327 <member name="M:Moq.Mock`1.ExpectSet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},``0)">
|
|
3328 <summary>
|
|
3329 Obsolete.
|
|
3330 </summary>
|
|
3331 </member>
|
|
3332 <member name="M:Moq.Mock`1.#ctor(System.Boolean)">
|
|
3333 <summary>
|
|
3334 Ctor invoked by AsTInterface exclusively.
|
|
3335 </summary>
|
|
3336 </member>
|
|
3337 <member name="M:Moq.Mock`1.#ctor">
|
|
3338 <summary>
|
|
3339 Initializes an instance of the mock with <see cref="F:Moq.MockBehavior.Default">default behavior</see>.
|
|
3340 </summary><example>
|
|
3341 <code>var mock = new Mock<IFormatProvider>();</code>
|
|
3342 </example>
|
|
3343 </member>
|
|
3344 <member name="M:Moq.Mock`1.#ctor(System.Object[])">
|
|
3345 <summary>
|
|
3346 Initializes an instance of the mock with <see cref="F:Moq.MockBehavior.Default">default behavior</see> and with
|
|
3347 the given constructor arguments for the class. (Only valid when <typeparamref name="T"/> is a class)
|
|
3348 </summary><remarks>
|
|
3349 The mock will try to find the best match constructor given the constructor arguments, and invoke that
|
|
3350 to initialize the instance. This applies only for classes, not interfaces.
|
|
3351 </remarks><example>
|
|
3352 <code>var mock = new Mock<MyProvider>(someArgument, 25);</code>
|
|
3353 </example><param name="args">Optional constructor arguments if the mocked type is a class.</param>
|
|
3354 </member>
|
|
3355 <member name="M:Moq.Mock`1.#ctor(Moq.MockBehavior)">
|
|
3356 <summary>
|
|
3357 Initializes an instance of the mock with the specified <see cref="T:Moq.MockBehavior">behavior</see>.
|
|
3358 </summary><example>
|
|
3359 <code>var mock = new Mock<IFormatProvider>(MockBehavior.Relaxed);</code>
|
|
3360 </example><param name="behavior">Behavior of the mock.</param>
|
|
3361 </member>
|
|
3362 <member name="M:Moq.Mock`1.#ctor(Moq.MockBehavior,System.Object[])">
|
|
3363 <summary>
|
|
3364 Initializes an instance of the mock with a specific <see cref="T:Moq.MockBehavior">behavior</see> with
|
|
3365 the given constructor arguments for the class.
|
|
3366 </summary><remarks>
|
|
3367 The mock will try to find the best match constructor given the constructor arguments, and invoke that
|
|
3368 to initialize the instance. This applies only to classes, not interfaces.
|
|
3369 </remarks><example>
|
|
3370 <code>var mock = new Mock<MyProvider>(someArgument, 25);</code>
|
|
3371 </example><param name="behavior">Behavior of the mock.</param><param name="args">Optional constructor arguments if the mocked type is a class.</param>
|
|
3372 </member>
|
|
3373 <member name="M:Moq.Mock`1.OnGetObject">
|
|
3374 <summary>
|
|
3375 Returns the mocked object value.
|
|
3376 </summary>
|
|
3377 </member>
|
|
3378 <member name="M:Moq.Mock`1.Setup(System.Linq.Expressions.Expression{System.Action{`0}})">
|
|
3379 <summary>
|
|
3380 Specifies a setup on the mocked type for a call to
|
|
3381 to a void method.
|
|
3382 </summary><remarks>
|
|
3383 If more than one setup is specified for the same method or property,
|
|
3384 the latest one wins and is the one that will be executed.
|
|
3385 </remarks><param name="expression">Lambda expression that specifies the expected method invocation.</param><example group="setups">
|
|
3386 <code>
|
|
3387 var mock = new Mock<IProcessor>();
|
|
3388 mock.Setup(x => x.Execute("ping"));
|
|
3389 </code>
|
|
3390 </example>
|
|
3391 </member>
|
|
3392 <member name="M:Moq.Mock`1.Setup``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3393 <summary>
|
|
3394 Specifies a setup on the mocked type for a call to
|
|
3395 to a value returning method.
|
|
3396 </summary><typeparam name="TResult">Type of the return value. Typically omitted as it can be inferred from the expression.</typeparam><remarks>
|
|
3397 If more than one setup is specified for the same method or property,
|
|
3398 the latest one wins and is the one that will be executed.
|
|
3399 </remarks><param name="expression">Lambda expression that specifies the method invocation.</param><example group="setups">
|
|
3400 <code>
|
|
3401 mock.Setup(x => x.HasInventory("Talisker", 50)).Returns(true);
|
|
3402 </code>
|
|
3403 </example>
|
|
3404 </member>
|
|
3405 <member name="M:Moq.Mock`1.SetupGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3406 <summary>
|
|
3407 Specifies a setup on the mocked type for a call to
|
|
3408 to a property getter.
|
|
3409 </summary><remarks>
|
|
3410 If more than one setup is set for the same property getter,
|
|
3411 the latest one wins and is the one that will be executed.
|
|
3412 </remarks><typeparam name="TProperty">Type of the property. Typically omitted as it can be inferred from the expression.</typeparam><param name="expression">Lambda expression that specifies the property getter.</param><example group="setups">
|
|
3413 <code>
|
|
3414 mock.SetupGet(x => x.Suspended)
|
|
3415 .Returns(true);
|
|
3416 </code>
|
|
3417 </example>
|
|
3418 </member>
|
|
3419 <member name="M:Moq.Mock`1.SetupSet``1(System.Action{`0})">
|
|
3420 <summary>
|
|
3421 Specifies a setup on the mocked type for a call to
|
|
3422 to a property setter.
|
|
3423 </summary><remarks>
|
|
3424 If more than one setup is set for the same property setter,
|
|
3425 the latest one wins and is the one that will be executed.
|
|
3426 <para>
|
|
3427 This overloads allows the use of a callback already
|
|
3428 typed for the property type.
|
|
3429 </para>
|
|
3430 </remarks><typeparam name="TProperty">Type of the property. Typically omitted as it can be inferred from the expression.</typeparam><param name="setterExpression">The Lambda expression that sets a property to a value.</param><example group="setups">
|
|
3431 <code>
|
|
3432 mock.SetupSet(x => x.Suspended = true);
|
|
3433 </code>
|
|
3434 </example>
|
|
3435 </member>
|
|
3436 <member name="M:Moq.Mock`1.SetupSet(System.Action{`0})">
|
|
3437 <summary>
|
|
3438 Specifies a setup on the mocked type for a call to
|
|
3439 to a property setter.
|
|
3440 </summary><remarks>
|
|
3441 If more than one setup is set for the same property setter,
|
|
3442 the latest one wins and is the one that will be executed.
|
|
3443 </remarks><param name="setterExpression">Lambda expression that sets a property to a value.</param><example group="setups">
|
|
3444 <code>
|
|
3445 mock.SetupSet(x => x.Suspended = true);
|
|
3446 </code>
|
|
3447 </example>
|
|
3448 </member>
|
|
3449 <member name="M:Moq.Mock`1.SetupProperty``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3450 <summary>
|
|
3451 Specifies that the given property should have "property behavior",
|
|
3452 meaning that setting its value will cause it to be saved and
|
|
3453 later returned when the property is requested. (this is also
|
|
3454 known as "stubbing").
|
|
3455 </summary><typeparam name="TProperty">
|
|
3456 Type of the property, inferred from the property
|
|
3457 expression (does not need to be specified).
|
|
3458 </typeparam><param name="property">Property expression to stub.</param><example>
|
|
3459 If you have an interface with an int property <c>Value</c>, you might
|
|
3460 stub it using the following straightforward call:
|
|
3461 <code>
|
|
3462 var mock = new Mock<IHaveValue>();
|
|
3463 mock.Stub(v => v.Value);
|
|
3464 </code>
|
|
3465 After the <c>Stub</c> call has been issued, setting and
|
|
3466 retrieving the object value will behave as expected:
|
|
3467 <code>
|
|
3468 IHaveValue v = mock.Object;
|
|
3469
|
|
3470 v.Value = 5;
|
|
3471 Assert.Equal(5, v.Value);
|
|
3472 </code>
|
|
3473 </example>
|
|
3474 </member>
|
|
3475 <member name="M:Moq.Mock`1.SetupProperty``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},``0)">
|
|
3476 <summary>
|
|
3477 Specifies that the given property should have "property behavior",
|
|
3478 meaning that setting its value will cause it to be saved and
|
|
3479 later returned when the property is requested. This overload
|
|
3480 allows setting the initial value for the property. (this is also
|
|
3481 known as "stubbing").
|
|
3482 </summary><typeparam name="TProperty">
|
|
3483 Type of the property, inferred from the property
|
|
3484 expression (does not need to be specified).
|
|
3485 </typeparam><param name="property">Property expression to stub.</param><param name="initialValue">Initial value for the property.</param><example>
|
|
3486 If you have an interface with an int property <c>Value</c>, you might
|
|
3487 stub it using the following straightforward call:
|
|
3488 <code>
|
|
3489 var mock = new Mock<IHaveValue>();
|
|
3490 mock.SetupProperty(v => v.Value, 5);
|
|
3491 </code>
|
|
3492 After the <c>SetupProperty</c> call has been issued, setting and
|
|
3493 retrieving the object value will behave as expected:
|
|
3494 <code>
|
|
3495 IHaveValue v = mock.Object;
|
|
3496 // Initial value was stored
|
|
3497 Assert.Equal(5, v.Value);
|
|
3498
|
|
3499 // New value set which changes the initial value
|
|
3500 v.Value = 6;
|
|
3501 Assert.Equal(6, v.Value);
|
|
3502 </code>
|
|
3503 </example>
|
|
3504 </member>
|
|
3505 <member name="M:Moq.Mock`1.SetupAllProperties">
|
|
3506 <summary>
|
|
3507 Specifies that the all properties on the mock should have "property behavior",
|
|
3508 meaning that setting its value will cause it to be saved and
|
|
3509 later returned when the property is requested. (this is also
|
|
3510 known as "stubbing"). The default value for each property will be the
|
|
3511 one generated as specified by the <see cref="P:Moq.Mock.DefaultValue"/> property for the mock.
|
|
3512 </summary><remarks>
|
|
3513 If the mock <see cref="P:Moq.Mock.DefaultValue"/> is set to <see cref="F:Moq.DefaultValue.Mock"/>,
|
|
3514 the mocked default values will also get all properties setup recursively.
|
|
3515 </remarks>
|
|
3516 </member>
|
|
3517 <member name="M:Moq.Mock`1.When(System.Func{System.Boolean})">
|
|
3518 <!-- No matching elements were found for the following include tag --><include file="Mock.Generic.xdoc" path="docs/doc[@for="Mock{T}.When"]/*"/>
|
|
3519 </member>
|
|
3520 <member name="M:Moq.Mock`1.Verify(System.Linq.Expressions.Expression{System.Action{`0}})">
|
|
3521 <summary>
|
|
3522 Verifies that a specific invocation matching the given expression was performed on the mock. Use
|
|
3523 in conjuntion with the default <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3524 </summary><example group="verification">
|
|
3525 This example assumes that the mock has been used, and later we want to verify that a given
|
|
3526 invocation with specific parameters was performed:
|
|
3527 <code>
|
|
3528 var mock = new Mock<IProcessor>();
|
|
3529 // exercise mock
|
|
3530 //...
|
|
3531 // Will throw if the test code didn't call Execute with a "ping" string argument.
|
|
3532 mock.Verify(proc => proc.Execute("ping"));
|
|
3533 </code>
|
|
3534 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="expression">Expression to verify.</param>
|
|
3535 </member>
|
|
3536 <member name="M:Moq.Mock`1.Verify(System.Linq.Expressions.Expression{System.Action{`0}},Moq.Times)">
|
|
3537 <summary>
|
|
3538 Verifies that a specific invocation matching the given expression was performed on the mock. Use
|
|
3539 in conjuntion with the default <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3540 </summary><exception cref="T:Moq.MockException">
|
|
3541 The invocation was not call the times specified by
|
|
3542 <paramref name="times"/>.
|
|
3543 </exception><param name="expression">Expression to verify.</param><param name="times">The number of times a method is allowed to be called.</param>
|
|
3544 </member>
|
|
3545 <member name="M:Moq.Mock`1.Verify(System.Linq.Expressions.Expression{System.Action{`0}},System.Func{Moq.Times})">
|
|
3546 <summary>
|
|
3547 Verifies that a specific invocation matching the given expression was performed on the mock. Use
|
|
3548 in conjuntion with the default <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3549 </summary><exception cref="T:Moq.MockException">
|
|
3550 The invocation was not call the times specified by
|
|
3551 <paramref name="times"/>.
|
|
3552 </exception><param name="expression">Expression to verify.</param><param name="times">The number of times a method is allowed to be called.</param>
|
|
3553 </member>
|
|
3554 <member name="M:Moq.Mock`1.Verify(System.Linq.Expressions.Expression{System.Action{`0}},System.String)">
|
|
3555 <summary>
|
|
3556 Verifies that a specific invocation matching the given expression was performed on the mock,
|
|
3557 specifying a failure error message. Use in conjuntion with the default
|
|
3558 <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3559 </summary><example group="verification">
|
|
3560 This example assumes that the mock has been used, and later we want to verify that a given
|
|
3561 invocation with specific parameters was performed:
|
|
3562 <code>
|
|
3563 var mock = new Mock<IProcessor>();
|
|
3564 // exercise mock
|
|
3565 //...
|
|
3566 // Will throw if the test code didn't call Execute with a "ping" string argument.
|
|
3567 mock.Verify(proc => proc.Execute("ping"));
|
|
3568 </code>
|
|
3569 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="expression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param>
|
|
3570 </member>
|
|
3571 <member name="M:Moq.Mock`1.Verify(System.Linq.Expressions.Expression{System.Action{`0}},Moq.Times,System.String)">
|
|
3572 <summary>
|
|
3573 Verifies that a specific invocation matching the given expression was performed on the mock,
|
|
3574 specifying a failure error message. Use in conjuntion with the default
|
|
3575 <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3576 </summary><exception cref="T:Moq.MockException">
|
|
3577 The invocation was not call the times specified by
|
|
3578 <paramref name="times"/>.
|
|
3579 </exception><param name="expression">Expression to verify.</param><param name="times">The number of times a method is allowed to be called.</param><param name="failMessage">Message to show if verification fails.</param>
|
|
3580 </member>
|
|
3581 <member name="M:Moq.Mock`1.Verify(System.Linq.Expressions.Expression{System.Action{`0}},System.Func{Moq.Times},System.String)">
|
|
3582 <summary>
|
|
3583 Verifies that a specific invocation matching the given expression was performed on the mock,
|
|
3584 specifying a failure error message. Use in conjuntion with the default
|
|
3585 <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3586 </summary><exception cref="T:Moq.MockException">
|
|
3587 The invocation was not call the times specified by
|
|
3588 <paramref name="times"/>.
|
|
3589 </exception><param name="expression">Expression to verify.</param><param name="times">The number of times a method is allowed to be called.</param><param name="failMessage">Message to show if verification fails.</param>
|
|
3590 </member>
|
|
3591 <member name="M:Moq.Mock`1.Verify``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3592 <summary>
|
|
3593 Verifies that a specific invocation matching the given expression was performed on the mock. Use
|
|
3594 in conjuntion with the default <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3595 </summary><example group="verification">
|
|
3596 This example assumes that the mock has been used, and later we want to verify that a given
|
|
3597 invocation with specific parameters was performed:
|
|
3598 <code>
|
|
3599 var mock = new Mock<IWarehouse>();
|
|
3600 // exercise mock
|
|
3601 //...
|
|
3602 // Will throw if the test code didn't call HasInventory.
|
|
3603 mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50));
|
|
3604 </code>
|
|
3605 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="expression">Expression to verify.</param><typeparam name="TResult">Type of return value from the expression.</typeparam>
|
|
3606 </member>
|
|
3607 <member name="M:Moq.Mock`1.Verify``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},Moq.Times)">
|
|
3608 <summary>
|
|
3609 Verifies that a specific invocation matching the given
|
|
3610 expression was performed on the mock. Use in conjuntion
|
|
3611 with the default <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3612 </summary><exception cref="T:Moq.MockException">
|
|
3613 The invocation was not call the times specified by
|
|
3614 <paramref name="times"/>.
|
|
3615 </exception><param name="expression">Expression to verify.</param><param name="times">The number of times a method is allowed to be called.</param><typeparam name="TResult">Type of return value from the expression.</typeparam>
|
|
3616 </member>
|
|
3617 <member name="M:Moq.Mock`1.Verify``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},System.Func{Moq.Times})">
|
|
3618 <summary>
|
|
3619 Verifies that a specific invocation matching the given
|
|
3620 expression was performed on the mock. Use in conjuntion
|
|
3621 with the default <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
3622 </summary><exception cref="T:Moq.MockException">
|
|
3623 The invocation was not call the times specified by
|
|
3624 <paramref name="times"/>.
|
|
3625 </exception><param name="expression">Expression to verify.</param><param name="times">The number of times a method is allowed to be called.</param><typeparam name="TResult">Type of return value from the expression.</typeparam>
|
|
3626 </member>
|
|
3627 <member name="M:Moq.Mock`1.Verify``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},System.String)">
|
|
3628 <summary>
|
|
3629 Verifies that a specific invocation matching the given
|
|
3630 expression was performed on the mock, specifying a failure
|
|
3631 error message.
|
|
3632 </summary><example group="verification">
|
|
3633 This example assumes that the mock has been used,
|
|
3634 and later we want to verify that a given invocation
|
|
3635 with specific parameters was performed:
|
|
3636 <code>
|
|
3637 var mock = new Mock<IWarehouse>();
|
|
3638 // exercise mock
|
|
3639 //...
|
|
3640 // Will throw if the test code didn't call HasInventory.
|
|
3641 mock.Verify(warehouse => warehouse.HasInventory(TALISKER, 50), "When filling orders, inventory has to be checked");
|
|
3642 </code>
|
|
3643 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="expression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param><typeparam name="TResult">Type of return value from the expression.</typeparam>
|
|
3644 </member>
|
|
3645 <member name="M:Moq.Mock`1.Verify``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},Moq.Times,System.String)">
|
|
3646 <summary>
|
|
3647 Verifies that a specific invocation matching the given
|
|
3648 expression was performed on the mock, specifying a failure
|
|
3649 error message.
|
|
3650 </summary><exception cref="T:Moq.MockException">
|
|
3651 The invocation was not call the times specified by
|
|
3652 <paramref name="times"/>.
|
|
3653 </exception><param name="expression">Expression to verify.</param><param name="times">The number of times a method is allowed to be called.</param><param name="failMessage">Message to show if verification fails.</param><typeparam name="TResult">Type of return value from the expression.</typeparam>
|
|
3654 </member>
|
|
3655 <member name="M:Moq.Mock`1.VerifyGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}})">
|
|
3656 <summary>
|
|
3657 Verifies that a property was read on the mock.
|
|
3658 </summary><example group="verification">
|
|
3659 This example assumes that the mock has been used,
|
|
3660 and later we want to verify that a given property
|
|
3661 was retrieved from it:
|
|
3662 <code>
|
|
3663 var mock = new Mock<IWarehouse>();
|
|
3664 // exercise mock
|
|
3665 //...
|
|
3666 // Will throw if the test code didn't retrieve the IsClosed property.
|
|
3667 mock.VerifyGet(warehouse => warehouse.IsClosed);
|
|
3668 </code>
|
|
3669 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="expression">Expression to verify.</param><typeparam name="TProperty">
|
|
3670 Type of the property to verify. Typically omitted as it can
|
|
3671 be inferred from the expression's return type.
|
|
3672 </typeparam>
|
|
3673 </member>
|
|
3674 <member name="M:Moq.Mock`1.VerifyGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},Moq.Times)">
|
|
3675 <summary>
|
|
3676 Verifies that a property was read on the mock.
|
|
3677 </summary><exception cref="T:Moq.MockException">
|
|
3678 The invocation was not call the times specified by
|
|
3679 <paramref name="times"/>.
|
|
3680 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="expression">Expression to verify.</param><typeparam name="TProperty">
|
|
3681 Type of the property to verify. Typically omitted as it can
|
|
3682 be inferred from the expression's return type.
|
|
3683 </typeparam>
|
|
3684 </member>
|
|
3685 <member name="M:Moq.Mock`1.VerifyGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},System.Func{Moq.Times})">
|
|
3686 <summary>
|
|
3687 Verifies that a property was read on the mock.
|
|
3688 </summary><exception cref="T:Moq.MockException">
|
|
3689 The invocation was not call the times specified by
|
|
3690 <paramref name="times"/>.
|
|
3691 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="expression">Expression to verify.</param><typeparam name="TProperty">
|
|
3692 Type of the property to verify. Typically omitted as it can
|
|
3693 be inferred from the expression's return type.
|
|
3694 </typeparam>
|
|
3695 </member>
|
|
3696 <member name="M:Moq.Mock`1.VerifyGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},System.String)">
|
|
3697 <summary>
|
|
3698 Verifies that a property was read on the mock, specifying a failure
|
|
3699 error message.
|
|
3700 </summary><example group="verification">
|
|
3701 This example assumes that the mock has been used,
|
|
3702 and later we want to verify that a given property
|
|
3703 was retrieved from it:
|
|
3704 <code>
|
|
3705 var mock = new Mock<IWarehouse>();
|
|
3706 // exercise mock
|
|
3707 //...
|
|
3708 // Will throw if the test code didn't retrieve the IsClosed property.
|
|
3709 mock.VerifyGet(warehouse => warehouse.IsClosed);
|
|
3710 </code>
|
|
3711 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="expression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param><typeparam name="TProperty">
|
|
3712 Type of the property to verify. Typically omitted as it can
|
|
3713 be inferred from the expression's return type.
|
|
3714 </typeparam>
|
|
3715 </member>
|
|
3716 <member name="M:Moq.Mock`1.VerifyGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},Moq.Times,System.String)">
|
|
3717 <summary>
|
|
3718 Verifies that a property was read on the mock, specifying a failure
|
|
3719 error message.
|
|
3720 </summary><exception cref="T:Moq.MockException">
|
|
3721 The invocation was not call the times specified by
|
|
3722 <paramref name="times"/>.
|
|
3723 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="expression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param><typeparam name="TProperty">
|
|
3724 Type of the property to verify. Typically omitted as it can
|
|
3725 be inferred from the expression's return type.
|
|
3726 </typeparam>
|
|
3727 </member>
|
|
3728 <member name="M:Moq.Mock`1.VerifyGet``1(System.Linq.Expressions.Expression{System.Func{`0,``0}},System.Func{Moq.Times},System.String)">
|
|
3729 <summary>
|
|
3730 Verifies that a property was read on the mock, specifying a failure
|
|
3731 error message.
|
|
3732 </summary><exception cref="T:Moq.MockException">
|
|
3733 The invocation was not call the times specified by
|
|
3734 <paramref name="times"/>.
|
|
3735 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="expression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param><typeparam name="TProperty">
|
|
3736 Type of the property to verify. Typically omitted as it can
|
|
3737 be inferred from the expression's return type.
|
|
3738 </typeparam>
|
|
3739 </member>
|
|
3740 <member name="M:Moq.Mock`1.VerifySet(System.Action{`0})">
|
|
3741 <summary>
|
|
3742 Verifies that a property was set on the mock.
|
|
3743 </summary><example group="verification">
|
|
3744 This example assumes that the mock has been used,
|
|
3745 and later we want to verify that a given property
|
|
3746 was set on it:
|
|
3747 <code>
|
|
3748 var mock = new Mock<IWarehouse>();
|
|
3749 // exercise mock
|
|
3750 //...
|
|
3751 // Will throw if the test code didn't set the IsClosed property.
|
|
3752 mock.VerifySet(warehouse => warehouse.IsClosed = true);
|
|
3753 </code>
|
|
3754 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="setterExpression">Expression to verify.</param>
|
|
3755 </member>
|
|
3756 <member name="M:Moq.Mock`1.VerifySet(System.Action{`0},Moq.Times)">
|
|
3757 <summary>
|
|
3758 Verifies that a property was set on the mock.
|
|
3759 </summary><exception cref="T:Moq.MockException">
|
|
3760 The invocation was not call the times specified by
|
|
3761 <paramref name="times"/>.
|
|
3762 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="setterExpression">Expression to verify.</param>
|
|
3763 </member>
|
|
3764 <member name="M:Moq.Mock`1.VerifySet(System.Action{`0},System.Func{Moq.Times})">
|
|
3765 <summary>
|
|
3766 Verifies that a property was set on the mock.
|
|
3767 </summary><exception cref="T:Moq.MockException">
|
|
3768 The invocation was not call the times specified by
|
|
3769 <paramref name="times"/>.
|
|
3770 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="setterExpression">Expression to verify.</param>
|
|
3771 </member>
|
|
3772 <member name="M:Moq.Mock`1.VerifySet(System.Action{`0},System.String)">
|
|
3773 <summary>
|
|
3774 Verifies that a property was set on the mock, specifying
|
|
3775 a failure message.
|
|
3776 </summary><example group="verification">
|
|
3777 This example assumes that the mock has been used,
|
|
3778 and later we want to verify that a given property
|
|
3779 was set on it:
|
|
3780 <code>
|
|
3781 var mock = new Mock<IWarehouse>();
|
|
3782 // exercise mock
|
|
3783 //...
|
|
3784 // Will throw if the test code didn't set the IsClosed property.
|
|
3785 mock.VerifySet(warehouse => warehouse.IsClosed = true, "Warehouse should always be closed after the action");
|
|
3786 </code>
|
|
3787 </example><exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception><param name="setterExpression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param>
|
|
3788 </member>
|
|
3789 <member name="M:Moq.Mock`1.VerifySet(System.Action{`0},Moq.Times,System.String)">
|
|
3790 <summary>
|
|
3791 Verifies that a property was set on the mock, specifying
|
|
3792 a failure message.
|
|
3793 </summary><exception cref="T:Moq.MockException">
|
|
3794 The invocation was not call the times specified by
|
|
3795 <paramref name="times"/>.
|
|
3796 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="setterExpression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param>
|
|
3797 </member>
|
|
3798 <member name="M:Moq.Mock`1.VerifySet(System.Action{`0},System.Func{Moq.Times},System.String)">
|
|
3799 <summary>
|
|
3800 Verifies that a property was set on the mock, specifying
|
|
3801 a failure message.
|
|
3802 </summary><exception cref="T:Moq.MockException">
|
|
3803 The invocation was not call the times specified by
|
|
3804 <paramref name="times"/>.
|
|
3805 </exception><param name="times">The number of times a method is allowed to be called.</param><param name="setterExpression">Expression to verify.</param><param name="failMessage">Message to show if verification fails.</param>
|
|
3806 </member>
|
|
3807 <member name="M:Moq.Mock`1.Raise(System.Action{`0},System.EventArgs)">
|
|
3808 <summary>
|
|
3809 Raises the event referenced in <paramref name="eventExpression"/> using
|
|
3810 the given <paramref name="args"/> argument.
|
|
3811 </summary><exception cref="T:System.ArgumentException">
|
|
3812 The <paramref name="args"/> argument is
|
|
3813 invalid for the target event invocation, or the <paramref name="eventExpression"/> is
|
|
3814 not an event attach or detach expression.
|
|
3815 </exception><example>
|
|
3816 The following example shows how to raise a <see cref="E:System.ComponentModel.INotifyPropertyChanged.PropertyChanged"/> event:
|
|
3817 <code>
|
|
3818 var mock = new Mock<IViewModel>();
|
|
3819
|
|
3820 mock.Raise(x => x.PropertyChanged -= null, new PropertyChangedEventArgs("Name"));
|
|
3821 </code>
|
|
3822 </example><example>
|
|
3823 This example shows how to invoke an event with a custom event arguments
|
|
3824 class in a view that will cause its corresponding presenter to
|
|
3825 react by changing its state:
|
|
3826 <code>
|
|
3827 var mockView = new Mock<IOrdersView>();
|
|
3828 var presenter = new OrdersPresenter(mockView.Object);
|
|
3829
|
|
3830 // Check that the presenter has no selection by default
|
|
3831 Assert.Null(presenter.SelectedOrder);
|
|
3832
|
|
3833 // Raise the event with a specific arguments data
|
|
3834 mockView.Raise(v => v.SelectionChanged += null, new OrderEventArgs { Order = new Order("moq", 500) });
|
|
3835
|
|
3836 // Now the presenter reacted to the event, and we have a selected order
|
|
3837 Assert.NotNull(presenter.SelectedOrder);
|
|
3838 Assert.Equal("moq", presenter.SelectedOrder.ProductName);
|
|
3839 </code>
|
|
3840 </example>
|
|
3841 </member>
|
|
3842 <member name="M:Moq.Mock`1.Raise(System.Action{`0},System.Object[])">
|
|
3843 <summary>
|
|
3844 Raises the event referenced in <paramref name="eventExpression"/> using
|
|
3845 the given <paramref name="args"/> argument for a non-EventHandler typed event.
|
|
3846 </summary><exception cref="T:System.ArgumentException">
|
|
3847 The <paramref name="args"/> arguments are
|
|
3848 invalid for the target event invocation, or the <paramref name="eventExpression"/> is
|
|
3849 not an event attach or detach expression.
|
|
3850 </exception><example>
|
|
3851 The following example shows how to raise a custom event that does not adhere to
|
|
3852 the standard <c>EventHandler</c>:
|
|
3853 <code>
|
|
3854 var mock = new Mock<IViewModel>();
|
|
3855
|
|
3856 mock.Raise(x => x.MyEvent -= null, "Name", bool, 25);
|
|
3857 </code>
|
|
3858 </example>
|
|
3859 </member>
|
|
3860 <member name="P:Moq.Mock`1.Object">
|
|
3861 <summary>
|
|
3862 Exposes the mocked object instance.
|
|
3863 </summary>
|
|
3864 </member>
|
|
3865 <member name="P:Moq.Mock`1.DelegateInterfaceMethod">
|
|
3866 <inheritdoc />
|
|
3867 </member>
|
|
3868 <member name="T:Moq.MockLegacyExtensions">
|
|
3869 <summary>
|
|
3870 Provides legacy API members as extensions so that
|
|
3871 existing code continues to compile, but new code
|
|
3872 doesn't see then.
|
|
3873 </summary>
|
|
3874 </member>
|
|
3875 <member name="M:Moq.MockLegacyExtensions.SetupSet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},``1)">
|
|
3876 <summary>
|
|
3877 Obsolete.
|
|
3878 </summary>
|
|
3879 </member>
|
|
3880 <member name="M:Moq.MockLegacyExtensions.VerifySet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},``1)">
|
|
3881 <summary>
|
|
3882 Obsolete.
|
|
3883 </summary>
|
|
3884 </member>
|
|
3885 <member name="M:Moq.MockLegacyExtensions.VerifySet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},``1,System.String)">
|
|
3886 <summary>
|
|
3887 Obsolete.
|
|
3888 </summary>
|
|
3889 </member>
|
|
3890 <member name="T:Moq.ObsoleteMockExtensions">
|
|
3891 <summary>
|
|
3892 Provides additional methods on mocks.
|
|
3893 </summary>
|
|
3894 <devdoc>
|
|
3895 Provided as extension methods as they confuse the compiler
|
|
3896 with the overloads taking Action.
|
|
3897 </devdoc>
|
|
3898 </member>
|
|
3899 <member name="M:Moq.ObsoleteMockExtensions.SetupSet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})">
|
|
3900 <summary>
|
|
3901 Specifies a setup on the mocked type for a call to
|
|
3902 to a property setter, regardless of its value.
|
|
3903 </summary>
|
|
3904 <remarks>
|
|
3905 If more than one setup is set for the same property setter,
|
|
3906 the latest one wins and is the one that will be executed.
|
|
3907 </remarks>
|
|
3908 <typeparam name="TProperty">Type of the property. Typically omitted as it can be inferred from the expression.</typeparam>
|
|
3909 <typeparam name="T">Type of the mock.</typeparam>
|
|
3910 <param name="mock">The target mock for the setup.</param>
|
|
3911 <param name="expression">Lambda expression that specifies the property setter.</param>
|
|
3912 <example group="setups">
|
|
3913 <code>
|
|
3914 mock.SetupSet(x => x.Suspended);
|
|
3915 </code>
|
|
3916 </example>
|
|
3917 <devdoc>
|
|
3918 This method is not legacy, but must be on an extension method to avoid
|
|
3919 confusing the compiler with the new Action syntax.
|
|
3920 </devdoc>
|
|
3921 </member>
|
|
3922 <member name="M:Moq.ObsoleteMockExtensions.VerifySet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})">
|
|
3923 <summary>
|
|
3924 Verifies that a property has been set on the mock, regarless of its value.
|
|
3925 </summary>
|
|
3926 <example group="verification">
|
|
3927 This example assumes that the mock has been used,
|
|
3928 and later we want to verify that a given invocation
|
|
3929 with specific parameters was performed:
|
|
3930 <code>
|
|
3931 var mock = new Mock<IWarehouse>();
|
|
3932 // exercise mock
|
|
3933 //...
|
|
3934 // Will throw if the test code didn't set the IsClosed property.
|
|
3935 mock.VerifySet(warehouse => warehouse.IsClosed);
|
|
3936 </code>
|
|
3937 </example>
|
|
3938 <exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception>
|
|
3939 <param name="expression">Expression to verify.</param>
|
|
3940 <param name="mock">The mock instance.</param>
|
|
3941 <typeparam name="T">Mocked type.</typeparam>
|
|
3942 <typeparam name="TProperty">Type of the property to verify. Typically omitted as it can
|
|
3943 be inferred from the expression's return type.</typeparam>
|
|
3944 </member>
|
|
3945 <member name="M:Moq.ObsoleteMockExtensions.VerifySet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},System.String)">
|
|
3946 <summary>
|
|
3947 Verifies that a property has been set on the mock, specifying a failure
|
|
3948 error message.
|
|
3949 </summary>
|
|
3950 <example group="verification">
|
|
3951 This example assumes that the mock has been used,
|
|
3952 and later we want to verify that a given invocation
|
|
3953 with specific parameters was performed:
|
|
3954 <code>
|
|
3955 var mock = new Mock<IWarehouse>();
|
|
3956 // exercise mock
|
|
3957 //...
|
|
3958 // Will throw if the test code didn't set the IsClosed property.
|
|
3959 mock.VerifySet(warehouse => warehouse.IsClosed);
|
|
3960 </code>
|
|
3961 </example>
|
|
3962 <exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception>
|
|
3963 <param name="expression">Expression to verify.</param>
|
|
3964 <param name="failMessage">Message to show if verification fails.</param>
|
|
3965 <param name="mock">The mock instance.</param>
|
|
3966 <typeparam name="T">Mocked type.</typeparam>
|
|
3967 <typeparam name="TProperty">Type of the property to verify. Typically omitted as it can
|
|
3968 be inferred from the expression's return type.</typeparam>
|
|
3969 </member>
|
|
3970 <member name="M:Moq.ObsoleteMockExtensions.VerifySet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},Moq.Times)">
|
|
3971 <summary>
|
|
3972 Verifies that a property has been set on the mock, regardless
|
|
3973 of the value but only the specified number of times.
|
|
3974 </summary>
|
|
3975 <example group="verification">
|
|
3976 This example assumes that the mock has been used,
|
|
3977 and later we want to verify that a given invocation
|
|
3978 with specific parameters was performed:
|
|
3979 <code>
|
|
3980 var mock = new Mock<IWarehouse>();
|
|
3981 // exercise mock
|
|
3982 //...
|
|
3983 // Will throw if the test code didn't set the IsClosed property.
|
|
3984 mock.VerifySet(warehouse => warehouse.IsClosed);
|
|
3985 </code>
|
|
3986 </example>
|
|
3987 <exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception>
|
|
3988 <exception cref="T:Moq.MockException">The invocation was not call the times specified by
|
|
3989 <paramref name="times"/>.</exception>
|
|
3990 <param name="mock">The mock instance.</param>
|
|
3991 <typeparam name="T">Mocked type.</typeparam>
|
|
3992 <param name="times">The number of times a method is allowed to be called.</param>
|
|
3993 <param name="expression">Expression to verify.</param>
|
|
3994 <typeparam name="TProperty">Type of the property to verify. Typically omitted as it can
|
|
3995 be inferred from the expression's return type.</typeparam>
|
|
3996 </member>
|
|
3997 <member name="M:Moq.ObsoleteMockExtensions.VerifySet``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},Moq.Times,System.String)">
|
|
3998 <summary>
|
|
3999 Verifies that a property has been set on the mock, regardless
|
|
4000 of the value but only the specified number of times, and specifying a failure
|
|
4001 error message.
|
|
4002 </summary>
|
|
4003 <example group="verification">
|
|
4004 This example assumes that the mock has been used,
|
|
4005 and later we want to verify that a given invocation
|
|
4006 with specific parameters was performed:
|
|
4007 <code>
|
|
4008 var mock = new Mock<IWarehouse>();
|
|
4009 // exercise mock
|
|
4010 //...
|
|
4011 // Will throw if the test code didn't set the IsClosed property.
|
|
4012 mock.VerifySet(warehouse => warehouse.IsClosed);
|
|
4013 </code>
|
|
4014 </example>
|
|
4015 <exception cref="T:Moq.MockException">The invocation was not performed on the mock.</exception>
|
|
4016 <exception cref="T:Moq.MockException">The invocation was not call the times specified by
|
|
4017 <paramref name="times"/>.</exception>
|
|
4018 <param name="mock">The mock instance.</param>
|
|
4019 <typeparam name="T">Mocked type.</typeparam>
|
|
4020 <param name="times">The number of times a method is allowed to be called.</param>
|
|
4021 <param name="failMessage">Message to show if verification fails.</param>
|
|
4022 <param name="expression">Expression to verify.</param>
|
|
4023 <typeparam name="TProperty">Type of the property to verify. Typically omitted as it can
|
|
4024 be inferred from the expression's return type.</typeparam>
|
|
4025 </member>
|
|
4026 <member name="T:Moq.SequenceExtensions">
|
|
4027 <summary>
|
|
4028 Helper for sequencing return values in the same method.
|
|
4029 </summary>
|
|
4030 </member>
|
|
4031 <member name="M:Moq.SequenceExtensions.SetupSequence``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})">
|
|
4032 <summary>
|
|
4033 Return a sequence of values, once per call.
|
|
4034 </summary>
|
|
4035 </member>
|
|
4036 <member name="M:Moq.ExpressionExtensions.ToLambda(System.Linq.Expressions.Expression)">
|
|
4037 <summary>
|
|
4038 Casts the expression to a lambda expression, removing
|
|
4039 a cast if there's any.
|
|
4040 </summary>
|
|
4041 </member>
|
|
4042 <member name="M:Moq.ExpressionExtensions.ToMethodCall(System.Linq.Expressions.LambdaExpression)">
|
|
4043 <summary>
|
|
4044 Casts the body of the lambda expression to a <see cref="T:System.Linq.Expressions.MethodCallExpression"/>.
|
|
4045 </summary>
|
|
4046 <exception cref="T:System.ArgumentException">If the body is not a method call.</exception>
|
|
4047 </member>
|
|
4048 <member name="M:Moq.ExpressionExtensions.ToPropertyInfo(System.Linq.Expressions.LambdaExpression)">
|
|
4049 <summary>
|
|
4050 Converts the body of the lambda expression into the <see cref="T:System.Reflection.PropertyInfo"/> referenced by it.
|
|
4051 </summary>
|
|
4052 </member>
|
|
4053 <member name="M:Moq.ExpressionExtensions.IsProperty(System.Linq.Expressions.LambdaExpression)">
|
|
4054 <summary>
|
|
4055 Checks whether the body of the lambda expression is a property access.
|
|
4056 </summary>
|
|
4057 </member>
|
|
4058 <member name="M:Moq.ExpressionExtensions.IsProperty(System.Linq.Expressions.Expression)">
|
|
4059 <summary>
|
|
4060 Checks whether the expression is a property access.
|
|
4061 </summary>
|
|
4062 </member>
|
|
4063 <member name="M:Moq.ExpressionExtensions.IsPropertyIndexer(System.Linq.Expressions.LambdaExpression)">
|
|
4064 <summary>
|
|
4065 Checks whether the body of the lambda expression is a property indexer, which is true
|
|
4066 when the expression is an <see cref="T:System.Linq.Expressions.MethodCallExpression"/> whose
|
|
4067 <see cref="P:System.Linq.Expressions.MethodCallExpression.Method"/> has <see cref="P:System.Reflection.MethodBase.IsSpecialName"/>
|
|
4068 equal to <see langword="true"/>.
|
|
4069 </summary>
|
|
4070 </member>
|
|
4071 <member name="M:Moq.ExpressionExtensions.IsPropertyIndexer(System.Linq.Expressions.Expression)">
|
|
4072 <summary>
|
|
4073 Checks whether the expression is a property indexer, which is true
|
|
4074 when the expression is an <see cref="T:System.Linq.Expressions.MethodCallExpression"/> whose
|
|
4075 <see cref="P:System.Linq.Expressions.MethodCallExpression.Method"/> has <see cref="P:System.Reflection.MethodBase.IsSpecialName"/>
|
|
4076 equal to <see langword="true"/>.
|
|
4077 </summary>
|
|
4078 </member>
|
|
4079 <member name="M:Moq.ExpressionExtensions.CastTo``1(System.Linq.Expressions.Expression)">
|
|
4080 <summary>
|
|
4081 Creates an expression that casts the given expression to the <typeparamref name="T"/>
|
|
4082 type.
|
|
4083 </summary>
|
|
4084 </member>
|
|
4085 <member name="M:Moq.ExpressionExtensions.ToStringFixed(System.Linq.Expressions.Expression)">
|
|
4086 <devdoc>
|
|
4087 TODO: remove this code when https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=331583
|
|
4088 is fixed.
|
|
4089 </devdoc>
|
|
4090 </member>
|
|
4091 <member name="M:Moq.ExpressionExtensions.GetCallInfo(System.Linq.Expressions.LambdaExpression,Moq.Mock)">
|
|
4092 <summary>
|
|
4093 Extracts, into a common form, information from a <see cref="T:System.Linq.Expressions.LambdaExpression"/>
|
|
4094 around either a <see cref="T:System.Linq.Expressions.MethodCallExpression"/> (for a normal method call)
|
|
4095 or a <see cref="T:System.Linq.Expressions.InvocationExpression"/> (for a delegate invocation).
|
|
4096 </summary>
|
|
4097 </member>
|
|
4098 <member name="M:Moq.Extensions.IsDelegate(System.Type)">
|
|
4099 <summary>
|
|
4100 Tests if a type is a delegate type (subclasses <see cref="T:System.Delegate"/>).
|
|
4101 </summary>
|
|
4102 </member>
|
|
4103 <member name="T:Moq.Evaluator">
|
|
4104 <summary>
|
|
4105 Provides partial evaluation of subtrees, whenever they can be evaluated locally.
|
|
4106 </summary>
|
|
4107 <author>Matt Warren: http://blogs.msdn.com/mattwar</author>
|
|
4108 <contributor>Documented by InSTEDD: http://www.instedd.org</contributor>
|
|
4109 </member>
|
|
4110 <member name="M:Moq.Evaluator.PartialEval(System.Linq.Expressions.Expression,System.Func{System.Linq.Expressions.Expression,System.Boolean})">
|
|
4111 <summary>
|
|
4112 Performs evaluation and replacement of independent sub-trees
|
|
4113 </summary>
|
|
4114 <param name="expression">The root of the expression tree.</param>
|
|
4115 <param name="fnCanBeEvaluated">A function that decides whether a given expression
|
|
4116 node can be part of the local function.</param>
|
|
4117 <returns>A new tree with sub-trees evaluated and replaced.</returns>
|
|
4118 </member>
|
|
4119 <member name="M:Moq.Evaluator.PartialEval(System.Linq.Expressions.Expression)">
|
|
4120 <summary>
|
|
4121 Performs evaluation and replacement of independent sub-trees
|
|
4122 </summary>
|
|
4123 <param name="expression">The root of the expression tree.</param>
|
|
4124 <returns>A new tree with sub-trees evaluated and replaced.</returns>
|
|
4125 </member>
|
|
4126 <member name="T:Moq.Evaluator.SubtreeEvaluator">
|
|
4127 <summary>
|
|
4128 Evaluates and replaces sub-trees when first candidate is reached (top-down)
|
|
4129 </summary>
|
|
4130 </member>
|
|
4131 <member name="T:Moq.Evaluator.Nominator">
|
|
4132 <summary>
|
|
4133 Performs bottom-up analysis to determine which nodes can possibly
|
|
4134 be part of an evaluated sub-tree.
|
|
4135 </summary>
|
|
4136 </member>
|
|
4137 <member name="M:Moq.Guard.NotNull``1(System.Linq.Expressions.Expression{System.Func{``0}},``0)">
|
|
4138 <summary>
|
|
4139 Ensures the given <paramref name="value"/> is not null.
|
|
4140 Throws <see cref="T:System.ArgumentNullException"/> otherwise.
|
|
4141 </summary>
|
|
4142 </member>
|
|
4143 <member name="M:Moq.Guard.NotNullOrEmpty(System.Linq.Expressions.Expression{System.Func{System.String}},System.String)">
|
|
4144 <summary>
|
|
4145 Ensures the given string <paramref name="value"/> is not null or empty.
|
|
4146 Throws <see cref="T:System.ArgumentNullException"/> in the first case, or
|
|
4147 <see cref="T:System.ArgumentException"/> in the latter.
|
|
4148 </summary>
|
|
4149 </member>
|
|
4150 <member name="M:Moq.Guard.NotOutOfRangeInclusive``1(System.Linq.Expressions.Expression{System.Func{``0}},``0,``0,``0)">
|
|
4151 <summary>
|
|
4152 Checks an argument to ensure it is in the specified range including the edges.
|
|
4153 </summary>
|
|
4154 <typeparam name="T">Type of the argument to check, it must be an <see cref="T:System.IComparable"/> type.
|
|
4155 </typeparam>
|
|
4156 <param name="reference">The expression containing the name of the argument.</param>
|
|
4157 <param name="value">The argument value to check.</param>
|
|
4158 <param name="from">The minimun allowed value for the argument.</param>
|
|
4159 <param name="to">The maximun allowed value for the argument.</param>
|
|
4160 </member>
|
|
4161 <member name="M:Moq.Guard.NotOutOfRangeExclusive``1(System.Linq.Expressions.Expression{System.Func{``0}},``0,``0,``0)">
|
|
4162 <summary>
|
|
4163 Checks an argument to ensure it is in the specified range excluding the edges.
|
|
4164 </summary>
|
|
4165 <typeparam name="T">Type of the argument to check, it must be an <see cref="T:System.IComparable"/> type.
|
|
4166 </typeparam>
|
|
4167 <param name="reference">The expression containing the name of the argument.</param>
|
|
4168 <param name="value">The argument value to check.</param>
|
|
4169 <param name="from">The minimun allowed value for the argument.</param>
|
|
4170 <param name="to">The maximun allowed value for the argument.</param>
|
|
4171 </member>
|
|
4172 <member name="T:Moq.IMocked`1">
|
|
4173 <summary>
|
|
4174 Implemented by all generated mock object instances.
|
|
4175 </summary>
|
|
4176 </member>
|
|
4177 <member name="T:Moq.IMocked">
|
|
4178 <summary>
|
|
4179 Implemented by all generated mock object instances.
|
|
4180 </summary>
|
|
4181 </member>
|
|
4182 <member name="P:Moq.IMocked.Mock">
|
|
4183 <summary>
|
|
4184 Reference the Mock that contains this as the <c>mock.Object</c> value.
|
|
4185 </summary>
|
|
4186 </member>
|
|
4187 <member name="P:Moq.IMocked`1.Mock">
|
|
4188 <summary>
|
|
4189 Reference the Mock that contains this as the <c>mock.Object</c> value.
|
|
4190 </summary>
|
|
4191 </member>
|
|
4192 <member name="T:Moq.Interceptor">
|
|
4193 <summary>
|
|
4194 Implements the actual interception and method invocation for
|
|
4195 all mocks.
|
|
4196 </summary>
|
|
4197 </member>
|
|
4198 <member name="T:Moq.Language.Flow.ISetupSetter`2">
|
|
4199 <summary>
|
|
4200 Implements the fluent API.
|
|
4201 </summary>
|
|
4202 </member>
|
|
4203 <member name="T:Moq.Language.ICallbackSetter`1">
|
|
4204 <summary>
|
|
4205 Defines the <c>Callback</c> verb for property setter setups.
|
|
4206 </summary>
|
|
4207 <typeparam name="TProperty">Type of the property.</typeparam>
|
|
4208 </member>
|
|
4209 <member name="M:Moq.Language.ICallbackSetter`1.Callback(System.Action{`0})">
|
|
4210 <summary>
|
|
4211 Specifies a callback to invoke when the property is set that receives the
|
|
4212 property value being set.
|
|
4213 </summary>
|
|
4214 <param name="action">Callback method to invoke.</param>
|
|
4215 <example>
|
|
4216 Invokes the given callback with the property value being set.
|
|
4217 <code>
|
|
4218 mock.SetupSet(x => x.Suspended)
|
|
4219 .Callback((bool state) => Console.WriteLine(state));
|
|
4220 </code>
|
|
4221 </example>
|
|
4222 </member>
|
|
4223 <member name="T:Moq.It">
|
|
4224 <summary>
|
|
4225 Allows the specification of a matching condition for an
|
|
4226 argument in a method invocation, rather than a specific
|
|
4227 argument value. "It" refers to the argument being matched.
|
|
4228 </summary><remarks>
|
|
4229 This class allows the setup to match a method invocation
|
|
4230 with an arbitrary value, with a value in a specified range, or
|
|
4231 even one that matches a given predicate.
|
|
4232 </remarks>
|
|
4233 </member>
|
|
4234 <member name="M:Moq.It.IsAny``1">
|
|
4235 <summary>
|
|
4236 Matches any value of the given <typeparamref name="TValue"/> type.
|
|
4237 </summary><remarks>
|
|
4238 Typically used when the actual argument value for a method
|
|
4239 call is not relevant.
|
|
4240 </remarks><example>
|
|
4241 <code>
|
|
4242 // Throws an exception for a call to Remove with any string value.
|
|
4243 mock.Setup(x => x.Remove(It.IsAny<string>())).Throws(new InvalidOperationException());
|
|
4244 </code>
|
|
4245 </example><typeparam name="TValue">Type of the value.</typeparam>
|
|
4246 </member>
|
|
4247 <member name="M:Moq.It.IsNotNull``1">
|
|
4248 <summary>
|
|
4249 Matches any value of the given <typeparamref name="TValue"/> type, except null.
|
|
4250 </summary><typeparam name="TValue">Type of the value.</typeparam>
|
|
4251 </member>
|
|
4252 <member name="M:Moq.It.Is``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
|
4253 <summary>
|
|
4254 Matches any value that satisfies the given predicate.
|
|
4255 </summary><typeparam name="TValue">Type of the argument to check.</typeparam><param name="match">The predicate used to match the method argument.</param><remarks>
|
|
4256 Allows the specification of a predicate to perform matching
|
|
4257 of method call arguments.
|
|
4258 </remarks><example>
|
|
4259 This example shows how to return the value <c>1</c> whenever the argument to the
|
|
4260 <c>Do</c> method is an even number.
|
|
4261 <code>
|
|
4262 mock.Setup(x => x.Do(It.Is<int>(i => i % 2 == 0)))
|
|
4263 .Returns(1);
|
|
4264 </code>
|
|
4265 This example shows how to throw an exception if the argument to the
|
|
4266 method is a negative number:
|
|
4267 <code>
|
|
4268 mock.Setup(x => x.GetUser(It.Is<int>(i => i < 0)))
|
|
4269 .Throws(new ArgumentException());
|
|
4270 </code>
|
|
4271 </example>
|
|
4272 </member>
|
|
4273 <member name="M:Moq.It.IsInRange``1(``0,``0,Moq.Range)">
|
|
4274 <summary>
|
|
4275 Matches any value that is in the range specified.
|
|
4276 </summary><typeparam name="TValue">Type of the argument to check.</typeparam><param name="from">The lower bound of the range.</param><param name="to">The upper bound of the range.</param><param name="rangeKind">
|
|
4277 The kind of range. See <see cref="T:Moq.Range"/>.
|
|
4278 </param><example>
|
|
4279 The following example shows how to expect a method call
|
|
4280 with an integer argument within the 0..100 range.
|
|
4281 <code>
|
|
4282 mock.Setup(x => x.HasInventory(
|
|
4283 It.IsAny<string>(),
|
|
4284 It.IsInRange(0, 100, Range.Inclusive)))
|
|
4285 .Returns(false);
|
|
4286 </code>
|
|
4287 </example>
|
|
4288 </member>
|
|
4289 <member name="M:Moq.It.IsIn``1(System.Collections.Generic.IEnumerable{``0})">
|
|
4290 <summary>
|
|
4291 Matches any value that is present in the sequence specified.
|
|
4292 </summary><typeparam name="TValue">Type of the argument to check.</typeparam><param name="items">The sequence of possible values.</param><example>
|
|
4293 The following example shows how to expect a method call
|
|
4294 with an integer argument with value from a list.
|
|
4295 <code>
|
|
4296 var values = new List<int> { 1, 2, 3 };
|
|
4297
|
|
4298 mock.Setup(x => x.HasInventory(
|
|
4299 It.IsAny<string>(),
|
|
4300 It.IsIn(values)))
|
|
4301 .Returns(false);
|
|
4302 </code>
|
|
4303 </example>
|
|
4304 </member>
|
|
4305 <member name="M:Moq.It.IsIn``1(``0[])">
|
|
4306 <summary>
|
|
4307 Matches any value that is present in the sequence specified.
|
|
4308 </summary><typeparam name="TValue">Type of the argument to check.</typeparam><param name="items">The sequence of possible values.</param><example>
|
|
4309 The following example shows how to expect a method call
|
|
4310 with an integer argument with a value of 1, 2, or 3.
|
|
4311 <code>
|
|
4312 mock.Setup(x => x.HasInventory(
|
|
4313 It.IsAny<string>(),
|
|
4314 It.IsIn(1, 2, 3)))
|
|
4315 .Returns(false);
|
|
4316 </code>
|
|
4317 </example>
|
|
4318 </member>
|
|
4319 <member name="M:Moq.It.IsNotIn``1(System.Collections.Generic.IEnumerable{``0})">
|
|
4320 <summary>
|
|
4321 Matches any value that is not found in the sequence specified.
|
|
4322 </summary><typeparam name="TValue">Type of the argument to check.</typeparam><param name="items">The sequence of disallowed values.</param><example>
|
|
4323 The following example shows how to expect a method call
|
|
4324 with an integer argument with value not found from a list.
|
|
4325 <code>
|
|
4326 var values = new List<int> { 1, 2, 3 };
|
|
4327
|
|
4328 mock.Setup(x => x.HasInventory(
|
|
4329 It.IsAny<string>(),
|
|
4330 It.IsNotIn(values)))
|
|
4331 .Returns(false);
|
|
4332 </code>
|
|
4333 </example>
|
|
4334 </member>
|
|
4335 <member name="M:Moq.It.IsNotIn``1(``0[])">
|
|
4336 <summary>
|
|
4337 Matches any value that is not found in the sequence specified.
|
|
4338 </summary><typeparam name="TValue">Type of the argument to check.</typeparam><param name="items">The sequence of disallowed values.</param><example>
|
|
4339 The following example shows how to expect a method call
|
|
4340 with an integer argument of any value except 1, 2, or 3.
|
|
4341 <code>
|
|
4342 mock.Setup(x => x.HasInventory(
|
|
4343 It.IsAny<string>(),
|
|
4344 It.IsNotIn(1, 2, 3)))
|
|
4345 .Returns(false);
|
|
4346 </code>
|
|
4347 </example>
|
|
4348 </member>
|
|
4349 <member name="M:Moq.It.IsRegex(System.String)">
|
|
4350 <summary>
|
|
4351 Matches a string argument if it matches the given regular expression pattern.
|
|
4352 </summary><param name="regex">The pattern to use to match the string argument value.</param><example>
|
|
4353 The following example shows how to expect a call to a method where the
|
|
4354 string argument matches the given regular expression:
|
|
4355 <code>
|
|
4356 mock.Setup(x => x.Check(It.IsRegex("[a-z]+"))).Returns(1);
|
|
4357 </code>
|
|
4358 </example>
|
|
4359 </member>
|
|
4360 <member name="M:Moq.It.IsRegex(System.String,System.Text.RegularExpressions.RegexOptions)">
|
|
4361 <summary>
|
|
4362 Matches a string argument if it matches the given regular expression pattern.
|
|
4363 </summary><param name="regex">The pattern to use to match the string argument value.</param><param name="options">The options used to interpret the pattern.</param><example>
|
|
4364 The following example shows how to expect a call to a method where the
|
|
4365 string argument matches the given regular expression, in a case insensitive way:
|
|
4366 <code>
|
|
4367 mock.Setup(x => x.Check(It.IsRegex("[a-z]+", RegexOptions.IgnoreCase))).Returns(1);
|
|
4368 </code>
|
|
4369 </example>
|
|
4370 </member>
|
|
4371 <member name="T:Moq.Matchers.MatcherAttributeMatcher">
|
|
4372 <summary>
|
|
4373 Matcher to treat static functions as matchers.
|
|
4374
|
|
4375 mock.Setup(x => x.StringMethod(A.MagicString()));
|
|
4376
|
|
4377 public static class A
|
|
4378 {
|
|
4379 [Matcher]
|
|
4380 public static string MagicString() { return null; }
|
|
4381 public static bool MagicString(string arg)
|
|
4382 {
|
|
4383 return arg == "magic";
|
|
4384 }
|
|
4385 }
|
|
4386
|
|
4387 Will succeed if: mock.Object.StringMethod("magic");
|
|
4388 and fail with any other call.
|
|
4389 </summary>
|
|
4390 </member>
|
|
4391 <member name="T:Moq.MockBehavior">
|
|
4392 <summary>
|
|
4393 Options to customize the behavior of the mock.
|
|
4394 </summary>
|
|
4395 </member>
|
|
4396 <member name="F:Moq.MockBehavior.Strict">
|
|
4397 <summary>
|
|
4398 Causes the mock to always throw
|
|
4399 an exception for invocations that don't have a
|
|
4400 corresponding setup.
|
|
4401 </summary>
|
|
4402 </member>
|
|
4403 <member name="F:Moq.MockBehavior.Loose">
|
|
4404 <summary>
|
|
4405 Will never throw exceptions, returning default
|
|
4406 values when necessary (null for reference types,
|
|
4407 zero for value types or empty enumerables and arrays).
|
|
4408 </summary>
|
|
4409 </member>
|
|
4410 <member name="F:Moq.MockBehavior.Default">
|
|
4411 <summary>
|
|
4412 Default mock behavior, which equals <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
4413 </summary>
|
|
4414 </member>
|
|
4415 <member name="T:Moq.MockException">
|
|
4416 <summary>
|
|
4417 Exception thrown by mocks when setups are not matched,
|
|
4418 the mock is not properly setup, etc.
|
|
4419 </summary>
|
|
4420 <remarks>
|
|
4421 A distinct exception type is provided so that exceptions
|
|
4422 thrown by the mock can be differentiated in tests that
|
|
4423 expect other exceptions to be thrown (i.e. ArgumentException).
|
|
4424 <para>
|
|
4425 Richer exception hierarchy/types are not provided as
|
|
4426 tests typically should <b>not</b> catch or expect exceptions
|
|
4427 from the mocks. These are typically the result of changes
|
|
4428 in the tested class or its collaborators implementation, and
|
|
4429 result in fixes in the mock setup so that they dissapear and
|
|
4430 allow the test to pass.
|
|
4431 </para>
|
|
4432 </remarks>
|
|
4433 </member>
|
|
4434 <member name="M:Moq.MockException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
|
|
4435 <summary>
|
|
4436 Supports the serialization infrastructure.
|
|
4437 </summary>
|
|
4438 <param name="info">Serialization information.</param>
|
|
4439 <param name="context">Streaming context.</param>
|
|
4440 </member>
|
|
4441 <member name="M:Moq.MockException.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
|
|
4442 <summary>
|
|
4443 Supports the serialization infrastructure.
|
|
4444 </summary>
|
|
4445 <param name="info">Serialization information.</param>
|
|
4446 <param name="context">Streaming context.</param>
|
|
4447 </member>
|
|
4448 <member name="P:Moq.MockException.IsVerificationError">
|
|
4449 <summary>
|
|
4450 Indicates whether this exception is a verification fault raised by Verify()
|
|
4451 </summary>
|
|
4452 </member>
|
|
4453 <member name="T:Moq.MockException.ExceptionReason">
|
|
4454 <summary>
|
|
4455 Made internal as it's of no use for
|
|
4456 consumers, but it's important for
|
|
4457 our own tests.
|
|
4458 </summary>
|
|
4459 </member>
|
|
4460 <member name="T:Moq.MockVerificationException">
|
|
4461 <devdoc>
|
|
4462 Used by the mock factory to accumulate verification
|
|
4463 failures.
|
|
4464 </devdoc>
|
|
4465 </member>
|
|
4466 <member name="M:Moq.MockVerificationException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
|
|
4467 <summary>
|
|
4468 Supports the serialization infrastructure.
|
|
4469 </summary>
|
|
4470 </member>
|
|
4471 <member name="T:Moq.Properties.Resources">
|
|
4472 <summary>
|
|
4473 A strongly-typed resource class, for looking up localized strings, etc.
|
|
4474 </summary>
|
|
4475 </member>
|
|
4476 <member name="P:Moq.Properties.Resources.ResourceManager">
|
|
4477 <summary>
|
|
4478 Returns the cached ResourceManager instance used by this class.
|
|
4479 </summary>
|
|
4480 </member>
|
|
4481 <member name="P:Moq.Properties.Resources.Culture">
|
|
4482 <summary>
|
|
4483 Overrides the current thread's CurrentUICulture property for all
|
|
4484 resource lookups using this strongly typed resource class.
|
|
4485 </summary>
|
|
4486 </member>
|
|
4487 <member name="P:Moq.Properties.Resources.AlreadyInitialized">
|
|
4488 <summary>
|
|
4489 Looks up a localized string similar to Mock type has already been initialized by accessing its Object property. Adding interfaces must be done before that..
|
|
4490 </summary>
|
|
4491 </member>
|
|
4492 <member name="P:Moq.Properties.Resources.ArgumentCannotBeEmpty">
|
|
4493 <summary>
|
|
4494 Looks up a localized string similar to Value cannot be an empty string..
|
|
4495 </summary>
|
|
4496 </member>
|
|
4497 <member name="P:Moq.Properties.Resources.AsMustBeInterface">
|
|
4498 <summary>
|
|
4499 Looks up a localized string similar to Can only add interfaces to the mock..
|
|
4500 </summary>
|
|
4501 </member>
|
|
4502 <member name="P:Moq.Properties.Resources.CantSetReturnValueForVoid">
|
|
4503 <summary>
|
|
4504 Looks up a localized string similar to Can't set return value for void method {0}..
|
|
4505 </summary>
|
|
4506 </member>
|
|
4507 <member name="P:Moq.Properties.Resources.ConstructorArgsForDelegate">
|
|
4508 <summary>
|
|
4509 Looks up a localized string similar to Constructor arguments cannot be passed for delegate mocks..
|
|
4510 </summary>
|
|
4511 </member>
|
|
4512 <member name="P:Moq.Properties.Resources.ConstructorArgsForInterface">
|
|
4513 <summary>
|
|
4514 Looks up a localized string similar to Constructor arguments cannot be passed for interface mocks..
|
|
4515 </summary>
|
|
4516 </member>
|
|
4517 <member name="P:Moq.Properties.Resources.ConstructorNotFound">
|
|
4518 <summary>
|
|
4519 Looks up a localized string similar to A matching constructor for the given arguments was not found on the mocked type..
|
|
4520 </summary>
|
|
4521 </member>
|
|
4522 <member name="P:Moq.Properties.Resources.EventNofFound">
|
|
4523 <summary>
|
|
4524 Looks up a localized string similar to Could not locate event for attach or detach method {0}..
|
|
4525 </summary>
|
|
4526 </member>
|
|
4527 <member name="P:Moq.Properties.Resources.FieldsNotSupported">
|
|
4528 <summary>
|
|
4529 Looks up a localized string similar to Expression {0} involves a field access, which is not supported. Use properties instead..
|
|
4530 </summary>
|
|
4531 </member>
|
|
4532 <member name="P:Moq.Properties.Resources.InvalidMockClass">
|
|
4533 <summary>
|
|
4534 Looks up a localized string similar to Type to mock must be an interface or an abstract or non-sealed class. .
|
|
4535 </summary>
|
|
4536 </member>
|
|
4537 <member name="P:Moq.Properties.Resources.InvalidMockGetType">
|
|
4538 <summary>
|
|
4539 Looks up a localized string similar to Cannot retrieve a mock with the given object type {0} as it's not the main type of the mock or any of its additional interfaces.
|
|
4540 Please cast the argument to one of the supported types: {1}.
|
|
4541 Remember that there's no generics covariance in the CLR, so your object must be one of these types in order for the call to succeed..
|
|
4542 </summary>
|
|
4543 </member>
|
|
4544 <member name="P:Moq.Properties.Resources.LinqBinaryOperatorNotSupported">
|
|
4545 <summary>
|
|
4546 Looks up a localized string similar to The equals ("==" or "=" in VB) and the conditional 'and' ("&&" or "AndAlso" in VB) operators are the only ones supported in the query specification expression. Unsupported expression: {0}.
|
|
4547 </summary>
|
|
4548 </member>
|
|
4549 <member name="P:Moq.Properties.Resources.LinqMethodNotSupported">
|
|
4550 <summary>
|
|
4551 Looks up a localized string similar to LINQ method '{0}' not supported..
|
|
4552 </summary>
|
|
4553 </member>
|
|
4554 <member name="P:Moq.Properties.Resources.LinqMethodNotVirtual">
|
|
4555 <summary>
|
|
4556 Looks up a localized string similar to Expression contains a call to a method which is not virtual (overridable in VB) or abstract. Unsupported expression: {0}.
|
|
4557 </summary>
|
|
4558 </member>
|
|
4559 <member name="P:Moq.Properties.Resources.MemberMissing">
|
|
4560 <summary>
|
|
4561 Looks up a localized string similar to Member {0}.{1} does not exist..
|
|
4562 </summary>
|
|
4563 </member>
|
|
4564 <member name="P:Moq.Properties.Resources.MethodIsPublic">
|
|
4565 <summary>
|
|
4566 Looks up a localized string similar to Method {0}.{1} is public. Use strong-typed Expect overload instead:
|
|
4567 mock.Setup(x => x.{1}());
|
|
4568 .
|
|
4569 </summary>
|
|
4570 </member>
|
|
4571 <member name="P:Moq.Properties.Resources.MockExceptionMessage">
|
|
4572 <summary>
|
|
4573 Looks up a localized string similar to {0} invocation failed with mock behavior {1}.
|
|
4574 {2}.
|
|
4575 </summary>
|
|
4576 </member>
|
|
4577 <member name="P:Moq.Properties.Resources.MoreThanNCalls">
|
|
4578 <summary>
|
|
4579 Looks up a localized string similar to Expected only {0} calls to {1}..
|
|
4580 </summary>
|
|
4581 </member>
|
|
4582 <member name="P:Moq.Properties.Resources.MoreThanOneCall">
|
|
4583 <summary>
|
|
4584 Looks up a localized string similar to Expected only one call to {0}..
|
|
4585 </summary>
|
|
4586 </member>
|
|
4587 <member name="P:Moq.Properties.Resources.NoMatchingCallsAtLeast">
|
|
4588 <summary>
|
|
4589 Looks up a localized string similar to {0}
|
|
4590 Expected invocation on the mock at least {2} times, but was {4} times: {1}.
|
|
4591 </summary>
|
|
4592 </member>
|
|
4593 <member name="P:Moq.Properties.Resources.NoMatchingCallsAtLeastOnce">
|
|
4594 <summary>
|
|
4595 Looks up a localized string similar to {0}
|
|
4596 Expected invocation on the mock at least once, but was never performed: {1}.
|
|
4597 </summary>
|
|
4598 </member>
|
|
4599 <member name="P:Moq.Properties.Resources.NoMatchingCallsAtMost">
|
|
4600 <summary>
|
|
4601 Looks up a localized string similar to {0}
|
|
4602 Expected invocation on the mock at most {3} times, but was {4} times: {1}.
|
|
4603 </summary>
|
|
4604 </member>
|
|
4605 <member name="P:Moq.Properties.Resources.NoMatchingCallsAtMostOnce">
|
|
4606 <summary>
|
|
4607 Looks up a localized string similar to {0}
|
|
4608 Expected invocation on the mock at most once, but was {4} times: {1}.
|
|
4609 </summary>
|
|
4610 </member>
|
|
4611 <member name="P:Moq.Properties.Resources.NoMatchingCallsBetweenExclusive">
|
|
4612 <summary>
|
|
4613 Looks up a localized string similar to {0}
|
|
4614 Expected invocation on the mock between {2} and {3} times (Exclusive), but was {4} times: {1}.
|
|
4615 </summary>
|
|
4616 </member>
|
|
4617 <member name="P:Moq.Properties.Resources.NoMatchingCallsBetweenInclusive">
|
|
4618 <summary>
|
|
4619 Looks up a localized string similar to {0}
|
|
4620 Expected invocation on the mock between {2} and {3} times (Inclusive), but was {4} times: {1}.
|
|
4621 </summary>
|
|
4622 </member>
|
|
4623 <member name="P:Moq.Properties.Resources.NoMatchingCallsExactly">
|
|
4624 <summary>
|
|
4625 Looks up a localized string similar to {0}
|
|
4626 Expected invocation on the mock exactly {2} times, but was {4} times: {1}.
|
|
4627 </summary>
|
|
4628 </member>
|
|
4629 <member name="P:Moq.Properties.Resources.NoMatchingCallsNever">
|
|
4630 <summary>
|
|
4631 Looks up a localized string similar to {0}
|
|
4632 Expected invocation on the mock should never have been performed, but was {4} times: {1}.
|
|
4633 </summary>
|
|
4634 </member>
|
|
4635 <member name="P:Moq.Properties.Resources.NoMatchingCallsOnce">
|
|
4636 <summary>
|
|
4637 Looks up a localized string similar to {0}
|
|
4638 Expected invocation on the mock once, but was {4} times: {1}.
|
|
4639 </summary>
|
|
4640 </member>
|
|
4641 <member name="P:Moq.Properties.Resources.NoSetup">
|
|
4642 <summary>
|
|
4643 Looks up a localized string similar to All invocations on the mock must have a corresponding setup..
|
|
4644 </summary>
|
|
4645 </member>
|
|
4646 <member name="P:Moq.Properties.Resources.ObjectInstanceNotMock">
|
|
4647 <summary>
|
|
4648 Looks up a localized string similar to Object instance was not created by Moq..
|
|
4649 </summary>
|
|
4650 </member>
|
|
4651 <member name="P:Moq.Properties.Resources.OutExpressionMustBeConstantValue">
|
|
4652 <summary>
|
|
4653 Looks up a localized string similar to Out expression must evaluate to a constant value..
|
|
4654 </summary>
|
|
4655 </member>
|
|
4656 <member name="P:Moq.Properties.Resources.PropertyGetNotFound">
|
|
4657 <summary>
|
|
4658 Looks up a localized string similar to Property {0}.{1} does not have a getter..
|
|
4659 </summary>
|
|
4660 </member>
|
|
4661 <member name="P:Moq.Properties.Resources.PropertyMissing">
|
|
4662 <summary>
|
|
4663 Looks up a localized string similar to Property {0}.{1} does not exist..
|
|
4664 </summary>
|
|
4665 </member>
|
|
4666 <member name="P:Moq.Properties.Resources.PropertyNotReadable">
|
|
4667 <summary>
|
|
4668 Looks up a localized string similar to Property {0}.{1} is write-only..
|
|
4669 </summary>
|
|
4670 </member>
|
|
4671 <member name="P:Moq.Properties.Resources.PropertyNotWritable">
|
|
4672 <summary>
|
|
4673 Looks up a localized string similar to Property {0}.{1} is read-only..
|
|
4674 </summary>
|
|
4675 </member>
|
|
4676 <member name="P:Moq.Properties.Resources.PropertySetNotFound">
|
|
4677 <summary>
|
|
4678 Looks up a localized string similar to Property {0}.{1} does not have a setter..
|
|
4679 </summary>
|
|
4680 </member>
|
|
4681 <member name="P:Moq.Properties.Resources.RaisedUnassociatedEvent">
|
|
4682 <summary>
|
|
4683 Looks up a localized string similar to Cannot raise a mocked event unless it has been associated (attached) to a concrete event in a mocked object..
|
|
4684 </summary>
|
|
4685 </member>
|
|
4686 <member name="P:Moq.Properties.Resources.RefExpressionMustBeConstantValue">
|
|
4687 <summary>
|
|
4688 Looks up a localized string similar to Ref expression must evaluate to a constant value..
|
|
4689 </summary>
|
|
4690 </member>
|
|
4691 <member name="P:Moq.Properties.Resources.ReturnValueRequired">
|
|
4692 <summary>
|
|
4693 Looks up a localized string similar to Invocation needs to return a value and therefore must have a corresponding setup that provides it..
|
|
4694 </summary>
|
|
4695 </member>
|
|
4696 <member name="P:Moq.Properties.Resources.SetupLambda">
|
|
4697 <summary>
|
|
4698 Looks up a localized string similar to A lambda expression is expected as the argument to It.Is<T>..
|
|
4699 </summary>
|
|
4700 </member>
|
|
4701 <member name="P:Moq.Properties.Resources.SetupNever">
|
|
4702 <summary>
|
|
4703 Looks up a localized string similar to Invocation {0} should not have been made..
|
|
4704 </summary>
|
|
4705 </member>
|
|
4706 <member name="P:Moq.Properties.Resources.SetupNotMethod">
|
|
4707 <summary>
|
|
4708 Looks up a localized string similar to Expression is not a method invocation: {0}.
|
|
4709 </summary>
|
|
4710 </member>
|
|
4711 <member name="P:Moq.Properties.Resources.SetupNotProperty">
|
|
4712 <summary>
|
|
4713 Looks up a localized string similar to Expression is not a property access: {0}.
|
|
4714 </summary>
|
|
4715 </member>
|
|
4716 <member name="P:Moq.Properties.Resources.SetupNotSetter">
|
|
4717 <summary>
|
|
4718 Looks up a localized string similar to Expression is not a property setter invocation..
|
|
4719 </summary>
|
|
4720 </member>
|
|
4721 <member name="P:Moq.Properties.Resources.SetupOnNonMemberMethod">
|
|
4722 <summary>
|
|
4723 Looks up a localized string similar to Expression references a method that does not belong to the mocked object: {0}.
|
|
4724 </summary>
|
|
4725 </member>
|
|
4726 <member name="P:Moq.Properties.Resources.SetupOnNonOverridableMember">
|
|
4727 <summary>
|
|
4728 Looks up a localized string similar to Invalid setup on a non-virtual (overridable in VB) member: {0}.
|
|
4729 </summary>
|
|
4730 </member>
|
|
4731 <member name="P:Moq.Properties.Resources.TypeNotImplementInterface">
|
|
4732 <summary>
|
|
4733 Looks up a localized string similar to Type {0} does not implement required interface {1}.
|
|
4734 </summary>
|
|
4735 </member>
|
|
4736 <member name="P:Moq.Properties.Resources.TypeNotInheritFromType">
|
|
4737 <summary>
|
|
4738 Looks up a localized string similar to Type {0} does not from required type {1}.
|
|
4739 </summary>
|
|
4740 </member>
|
|
4741 <member name="P:Moq.Properties.Resources.UnexpectedPublicProperty">
|
|
4742 <summary>
|
|
4743 Looks up a localized string similar to To specify a setup for public property {0}.{1}, use the typed overloads, such as:
|
|
4744 mock.Setup(x => x.{1}).Returns(value);
|
|
4745 mock.SetupGet(x => x.{1}).Returns(value); //equivalent to previous one
|
|
4746 mock.SetupSet(x => x.{1}).Callback(callbackDelegate);
|
|
4747 .
|
|
4748 </summary>
|
|
4749 </member>
|
|
4750 <member name="P:Moq.Properties.Resources.UnsupportedExpression">
|
|
4751 <summary>
|
|
4752 Looks up a localized string similar to Unsupported expression: {0}.
|
|
4753 </summary>
|
|
4754 </member>
|
|
4755 <member name="P:Moq.Properties.Resources.UnsupportedIntermediateExpression">
|
|
4756 <summary>
|
|
4757 Looks up a localized string similar to Only property accesses are supported in intermediate invocations on a setup. Unsupported expression {0}..
|
|
4758 </summary>
|
|
4759 </member>
|
|
4760 <member name="P:Moq.Properties.Resources.UnsupportedIntermediateType">
|
|
4761 <summary>
|
|
4762 Looks up a localized string similar to Expression contains intermediate property access {0}.{1} which is of type {2} and cannot be mocked. Unsupported expression {3}..
|
|
4763 </summary>
|
|
4764 </member>
|
|
4765 <member name="P:Moq.Properties.Resources.UnsupportedMatcherParamsForSetter">
|
|
4766 <summary>
|
|
4767 Looks up a localized string similar to Setter expression cannot use argument matchers that receive parameters..
|
|
4768 </summary>
|
|
4769 </member>
|
|
4770 <member name="P:Moq.Properties.Resources.UnsupportedMember">
|
|
4771 <summary>
|
|
4772 Looks up a localized string similar to Member {0} is not supported for protected mocking..
|
|
4773 </summary>
|
|
4774 </member>
|
|
4775 <member name="P:Moq.Properties.Resources.UnsupportedNonStaticMatcherForSetter">
|
|
4776 <summary>
|
|
4777 Looks up a localized string similar to Setter expression can only use static custom matchers..
|
|
4778 </summary>
|
|
4779 </member>
|
|
4780 <member name="P:Moq.Properties.Resources.VerficationFailed">
|
|
4781 <summary>
|
|
4782 Looks up a localized string similar to The following setups were not matched:
|
|
4783 {0}.
|
|
4784 </summary>
|
|
4785 </member>
|
|
4786 <member name="P:Moq.Properties.Resources.VerifyOnNonVirtualMember">
|
|
4787 <summary>
|
|
4788 Looks up a localized string similar to Invalid verify on a non-virtual (overridable in VB) member: {0}.
|
|
4789 </summary>
|
|
4790 </member>
|
|
4791 <member name="T:Moq.Protected.IProtectedMock`1">
|
|
4792 <summary>
|
|
4793 Allows setups to be specified for protected members by using their
|
|
4794 name as a string, rather than strong-typing them which is not possible
|
|
4795 due to their visibility.
|
|
4796 </summary>
|
|
4797 </member>
|
|
4798 <member name="M:Moq.Protected.IProtectedMock`1.Setup(System.String,System.Object[])">
|
|
4799 <summary>
|
|
4800 Specifies a setup for a void method invocation with the given
|
|
4801 <paramref name="voidMethodName"/>, optionally specifying arguments for the method call.
|
|
4802 </summary>
|
|
4803 <param name="voidMethodName">The name of the void method to be invoked.</param>
|
|
4804 <param name="args">The optional arguments for the invocation. If argument matchers are used,
|
|
4805 remember to use <see cref="T:Moq.Protected.ItExpr"/> rather than <see cref="T:Moq.It"/>.</param>
|
|
4806 </member>
|
|
4807 <member name="M:Moq.Protected.IProtectedMock`1.Setup``1(System.String,System.Object[])">
|
|
4808 <summary>
|
|
4809 Specifies a setup for an invocation on a property or a non void method with the given
|
|
4810 <paramref name="methodOrPropertyName"/>, optionally specifying arguments for the method call.
|
|
4811 </summary>
|
|
4812 <param name="methodOrPropertyName">The name of the method or property to be invoked.</param>
|
|
4813 <param name="args">The optional arguments for the invocation. If argument matchers are used,
|
|
4814 remember to use <see cref="T:Moq.Protected.ItExpr"/> rather than <see cref="T:Moq.It"/>.</param>
|
|
4815 <typeparam name="TResult">The return type of the method or property.</typeparam>
|
|
4816 </member>
|
|
4817 <member name="M:Moq.Protected.IProtectedMock`1.SetupGet``1(System.String)">
|
|
4818 <summary>
|
|
4819 Specifies a setup for an invocation on a property getter with the given
|
|
4820 <paramref name="propertyName"/>.
|
|
4821 </summary>
|
|
4822 <param name="propertyName">The name of the property.</param>
|
|
4823 <typeparam name="TProperty">The type of the property.</typeparam>
|
|
4824 </member>
|
|
4825 <member name="M:Moq.Protected.IProtectedMock`1.SetupSet``1(System.String,System.Object)">
|
|
4826 <summary>
|
|
4827 Specifies a setup for an invocation on a property setter with the given
|
|
4828 <paramref name="propertyName"/>.
|
|
4829 </summary>
|
|
4830 <param name="propertyName">The name of the property.</param>
|
|
4831 <param name="value">The property value. If argument matchers are used,
|
|
4832 remember to use <see cref="T:Moq.Protected.ItExpr"/> rather than <see cref="T:Moq.It"/>.</param>
|
|
4833 <typeparam name="TProperty">The type of the property.</typeparam>
|
|
4834 </member>
|
|
4835 <member name="M:Moq.Protected.IProtectedMock`1.Verify(System.String,Moq.Times,System.Object[])">
|
|
4836 <summary>
|
|
4837 Specifies a verify for a void method with the given <paramref name="methodName"/>,
|
|
4838 optionally specifying arguments for the method call. Use in conjuntion with the default
|
|
4839 <see cref="F:Moq.MockBehavior.Loose"/>.
|
|
4840 </summary>
|
|
4841 <exception cref="T:Moq.MockException">The invocation was not call the times specified by
|
|
4842 <paramref name="times"/>.</exception>
|
|
4843 <param name="methodName">The name of the void method to be verified.</param>
|
|
4844 <param name="times">The number of times a method is allowed to be called.</param>
|
|
4845 <param name="args">The optional arguments for the invocation. If argument matchers are used,
|
|
4846 remember to use <see cref="T:Moq.Protected.ItExpr"/> rather than <see cref="T:Moq.It"/>.</param>
|
|
4847 </member>
|
|
4848 <member name="M:Moq.Protected.IProtectedMock`1.Verify``1(System.String,Moq.Times,System.Object[])">
|
|
4849 <summary>
|
|
4850 Specifies a verify for an invocation on a property or a non void method with the given
|
|
4851 <paramref name="methodName"/>, optionally specifying arguments for the method call.
|
|
4852 </summary>
|
|
4853 <exception cref="T:Moq.MockException">The invocation was not call the times specified by
|
|
4854 <paramref name="times"/>.</exception>
|
|
4855 <param name="methodName">The name of the method or property to be invoked.</param>
|
|
4856 <param name="args">The optional arguments for the invocation. If argument matchers are used,
|
|
4857 remember to use <see cref="T:Moq.Protected.ItExpr"/> rather than <see cref="T:Moq.It"/>.</param>
|
|
4858 <param name="times">The number of times a method is allowed to be called.</param>
|
|
4859 <typeparam name="TResult">The type of return value from the expression.</typeparam>
|
|
4860 </member>
|
|
4861 <member name="M:Moq.Protected.IProtectedMock`1.VerifyGet``1(System.String,Moq.Times)">
|
|
4862 <summary>
|
|
4863 Specifies a verify for an invocation on a property getter with the given
|
|
4864 <paramref name="propertyName"/>.
|
|
4865 <exception cref="T:Moq.MockException">The invocation was not call the times specified by
|
|
4866 <paramref name="times"/>.</exception>
|
|
4867 </summary>
|
|
4868 <param name="propertyName">The name of the property.</param>
|
|
4869 <param name="times">The number of times a method is allowed to be called.</param>
|
|
4870 <typeparam name="TProperty">The type of the property.</typeparam>
|
|
4871 </member>
|
|
4872 <member name="M:Moq.Protected.IProtectedMock`1.VerifySet``1(System.String,Moq.Times,System.Object)">
|
|
4873 <summary>
|
|
4874 Specifies a setup for an invocation on a property setter with the given
|
|
4875 <paramref name="propertyName"/>.
|
|
4876 </summary>
|
|
4877 <exception cref="T:Moq.MockException">The invocation was not call the times specified by
|
|
4878 <paramref name="times"/>.</exception>
|
|
4879 <param name="propertyName">The name of the property.</param>
|
|
4880 <param name="times">The number of times a method is allowed to be called.</param>
|
|
4881 <param name="value">The property value.</param>
|
|
4882 <typeparam name="TProperty">The type of the property. If argument matchers are used,
|
|
4883 remember to use <see cref="T:Moq.Protected.ItExpr"/> rather than <see cref="T:Moq.It"/>.</typeparam>
|
|
4884 </member>
|
|
4885 <member name="T:Moq.Protected.ItExpr">
|
|
4886 <summary>
|
|
4887 Allows the specification of a matching condition for an
|
|
4888 argument in a protected member setup, rather than a specific
|
|
4889 argument value. "ItExpr" refers to the argument being matched.
|
|
4890 </summary>
|
|
4891 <remarks>
|
|
4892 <para>Use this variant of argument matching instead of
|
|
4893 <see cref="T:Moq.It"/> for protected setups.</para>
|
|
4894 This class allows the setup to match a method invocation
|
|
4895 with an arbitrary value, with a value in a specified range, or
|
|
4896 even one that matches a given predicate, or null.
|
|
4897 </remarks>
|
|
4898 </member>
|
|
4899 <member name="M:Moq.Protected.ItExpr.IsNull``1">
|
|
4900 <summary>
|
|
4901 Matches a null value of the given <typeparamref name="TValue"/> type.
|
|
4902 </summary>
|
|
4903 <remarks>
|
|
4904 Required for protected mocks as the null value cannot be used
|
|
4905 directly as it prevents proper method overload selection.
|
|
4906 </remarks>
|
|
4907 <example>
|
|
4908 <code>
|
|
4909 // Throws an exception for a call to Remove with a null string value.
|
|
4910 mock.Protected()
|
|
4911 .Setup("Remove", ItExpr.IsNull<string>())
|
|
4912 .Throws(new InvalidOperationException());
|
|
4913 </code>
|
|
4914 </example>
|
|
4915 <typeparam name="TValue">Type of the value.</typeparam>
|
|
4916 </member>
|
|
4917 <member name="M:Moq.Protected.ItExpr.IsAny``1">
|
|
4918 <summary>
|
|
4919 Matches any value of the given <typeparamref name="TValue"/> type.
|
|
4920 </summary>
|
|
4921 <remarks>
|
|
4922 Typically used when the actual argument value for a method
|
|
4923 call is not relevant.
|
|
4924 </remarks>
|
|
4925 <example>
|
|
4926 <code>
|
|
4927 // Throws an exception for a call to Remove with any string value.
|
|
4928 mock.Protected()
|
|
4929 .Setup("Remove", ItExpr.IsAny<string>())
|
|
4930 .Throws(new InvalidOperationException());
|
|
4931 </code>
|
|
4932 </example>
|
|
4933 <typeparam name="TValue">Type of the value.</typeparam>
|
|
4934 </member>
|
|
4935 <member name="M:Moq.Protected.ItExpr.Is``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
|
4936 <summary>
|
|
4937 Matches any value that satisfies the given predicate.
|
|
4938 </summary>
|
|
4939 <typeparam name="TValue">Type of the argument to check.</typeparam>
|
|
4940 <param name="match">The predicate used to match the method argument.</param>
|
|
4941 <remarks>
|
|
4942 Allows the specification of a predicate to perform matching
|
|
4943 of method call arguments.
|
|
4944 </remarks>
|
|
4945 <example>
|
|
4946 This example shows how to return the value <c>1</c> whenever the argument to the
|
|
4947 <c>Do</c> method is an even number.
|
|
4948 <code>
|
|
4949 mock.Protected()
|
|
4950 .Setup("Do", ItExpr.Is<int>(i => i % 2 == 0))
|
|
4951 .Returns(1);
|
|
4952 </code>
|
|
4953 This example shows how to throw an exception if the argument to the
|
|
4954 method is a negative number:
|
|
4955 <code>
|
|
4956 mock.Protected()
|
|
4957 .Setup("GetUser", ItExpr.Is<int>(i => i < 0))
|
|
4958 .Throws(new ArgumentException());
|
|
4959 </code>
|
|
4960 </example>
|
|
4961 </member>
|
|
4962 <member name="M:Moq.Protected.ItExpr.IsInRange``1(``0,``0,Moq.Range)">
|
|
4963 <summary>
|
|
4964 Matches any value that is in the range specified.
|
|
4965 </summary>
|
|
4966 <typeparam name="TValue">Type of the argument to check.</typeparam>
|
|
4967 <param name="from">The lower bound of the range.</param>
|
|
4968 <param name="to">The upper bound of the range.</param>
|
|
4969 <param name="rangeKind">The kind of range. See <see cref="T:Moq.Range"/>.</param>
|
|
4970 <example>
|
|
4971 The following example shows how to expect a method call
|
|
4972 with an integer argument within the 0..100 range.
|
|
4973 <code>
|
|
4974 mock.Protected()
|
|
4975 .Setup("HasInventory",
|
|
4976 ItExpr.IsAny<string>(),
|
|
4977 ItExpr.IsInRange(0, 100, Range.Inclusive))
|
|
4978 .Returns(false);
|
|
4979 </code>
|
|
4980 </example>
|
|
4981 </member>
|
|
4982 <member name="M:Moq.Protected.ItExpr.IsRegex(System.String)">
|
|
4983 <summary>
|
|
4984 Matches a string argument if it matches the given regular expression pattern.
|
|
4985 </summary>
|
|
4986 <param name="regex">The pattern to use to match the string argument value.</param>
|
|
4987 <example>
|
|
4988 The following example shows how to expect a call to a method where the
|
|
4989 string argument matches the given regular expression:
|
|
4990 <code>
|
|
4991 mock.Protected()
|
|
4992 .Setup("Check", ItExpr.IsRegex("[a-z]+"))
|
|
4993 .Returns(1);
|
|
4994 </code>
|
|
4995 </example>
|
|
4996 </member>
|
|
4997 <member name="M:Moq.Protected.ItExpr.IsRegex(System.String,System.Text.RegularExpressions.RegexOptions)">
|
|
4998 <summary>
|
|
4999 Matches a string argument if it matches the given regular expression pattern.
|
|
5000 </summary>
|
|
5001 <param name="regex">The pattern to use to match the string argument value.</param>
|
|
5002 <param name="options">The options used to interpret the pattern.</param>
|
|
5003 <example>
|
|
5004 The following example shows how to expect a call to a method where the
|
|
5005 string argument matches the given regular expression, in a case insensitive way:
|
|
5006 <code>
|
|
5007 mock.Protected()
|
|
5008 .Setup("Check", ItExpr.IsRegex("[a-z]+", RegexOptions.IgnoreCase))
|
|
5009 .Returns(1);
|
|
5010 </code>
|
|
5011 </example>
|
|
5012 </member>
|
|
5013 <member name="T:Moq.Protected.ProtectedExtension">
|
|
5014 <summary>
|
|
5015 Enables the <c>Protected()</c> method on <see cref="T:Moq.Mock`1"/>,
|
|
5016 allowing setups to be set for protected members by using their
|
|
5017 name as a string, rather than strong-typing them which is not possible
|
|
5018 due to their visibility.
|
|
5019 </summary>
|
|
5020 </member>
|
|
5021 <member name="M:Moq.Protected.ProtectedExtension.Protected``1(Moq.Mock{``0})">
|
|
5022 <summary>
|
|
5023 Enable protected setups for the mock.
|
|
5024 </summary>
|
|
5025 <typeparam name="T">Mocked object type. Typically omitted as it can be inferred from the mock instance.</typeparam>
|
|
5026 <param name="mock">The mock to set the protected setups on.</param>
|
|
5027 </member>
|
|
5028 <member name="T:ThisAssembly">
|
|
5029 <group name="overview" title="Overview" order="0" />
|
|
5030 <group name="setups" title="Specifying setups" order="1" />
|
|
5031 <group name="returns" title="Returning values from members" order="2" />
|
|
5032 <group name="verification" title="Verifying setups" order="3" />
|
|
5033 <group name="advanced" title="Advanced scenarios" order="99" />
|
|
5034 <group name="factory" title="Using MockFactory for consistency across mocks" order="4" />
|
|
5035 </member>
|
|
5036 <member name="T:Moq.Range">
|
|
5037 <summary>
|
|
5038 Kind of range to use in a filter specified through
|
|
5039 <see cref="M:Moq.It.IsInRange``1(``0,``0,Moq.Range)"/>.
|
|
5040 </summary>
|
|
5041 </member>
|
|
5042 <member name="F:Moq.Range.Inclusive">
|
|
5043 <summary>
|
|
5044 The range includes the <c>to</c> and
|
|
5045 <c>from</c> values.
|
|
5046 </summary>
|
|
5047 </member>
|
|
5048 <member name="F:Moq.Range.Exclusive">
|
|
5049 <summary>
|
|
5050 The range does not include the <c>to</c> and
|
|
5051 <c>from</c> values.
|
|
5052 </summary>
|
|
5053 </member>
|
|
5054 <member name="T:Moq.DefaultValue">
|
|
5055 <summary>
|
|
5056 Determines the way default values are generated
|
|
5057 calculated for loose mocks.
|
|
5058 </summary>
|
|
5059 </member>
|
|
5060 <member name="F:Moq.DefaultValue.Empty">
|
|
5061 <summary>
|
|
5062 Default behavior, which generates empty values for
|
|
5063 value types (i.e. default(int)), empty array and
|
|
5064 enumerables, and nulls for all other reference types.
|
|
5065 </summary>
|
|
5066 </member>
|
|
5067 <member name="F:Moq.DefaultValue.Mock">
|
|
5068 <summary>
|
|
5069 Whenever the default value generated by <see cref="F:Moq.DefaultValue.Empty"/>
|
|
5070 is null, replaces this value with a mock (if the type
|
|
5071 can be mocked).
|
|
5072 </summary>
|
|
5073 <remarks>
|
|
5074 For sealed classes, a null value will be generated.
|
|
5075 </remarks>
|
|
5076 </member>
|
|
5077 <member name="T:Moq.Linq.MockQueryable`1">
|
|
5078 <summary>
|
|
5079 A default implementation of IQueryable for use with QueryProvider
|
|
5080 </summary>
|
|
5081 </member>
|
|
5082 <member name="M:Moq.Linq.MockQueryable`1.#ctor(System.Linq.Expressions.MethodCallExpression)">
|
|
5083 <summary>
|
|
5084 The <paramref name="underlyingCreateMocks"/> is a
|
|
5085 static method that returns an IQueryable of Mocks of T which is used to
|
|
5086 apply the linq specification to.
|
|
5087 </summary>
|
|
5088 </member>
|
|
5089 <member name="T:Moq.Match">
|
|
5090 <summary>
|
|
5091 Allows creation custom value matchers that can be used on setups and verification,
|
|
5092 completely replacing the built-in <see cref="T:Moq.It"/> class with your own argument
|
|
5093 matching rules.
|
|
5094 </summary><remarks>
|
|
5095 See also <see cref="T:Moq.Match`1"/>.
|
|
5096 </remarks>
|
|
5097 </member>
|
|
5098 <member name="M:Moq.Match.Matcher``1">
|
|
5099 <devdoc>
|
|
5100 Provided for the sole purpose of rendering the delegate passed to the
|
|
5101 matcher constructor if no friendly render lambda is provided.
|
|
5102 </devdoc>
|
|
5103 </member>
|
|
5104 <member name="M:Moq.Match.Create``1(System.Predicate{``0})">
|
|
5105 <summary>
|
|
5106 Initializes the match with the condition that
|
|
5107 will be checked in order to match invocation
|
|
5108 values.
|
|
5109 </summary><param name="condition">The condition to match against actual values.</param><remarks>
|
|
5110 <seealso cref="T:Moq.Match`1"/>
|
|
5111 </remarks>
|
|
5112 </member>
|
|
5113 <member name="M:Moq.Match.Create``1(System.Predicate{``0},System.Linq.Expressions.Expression{System.Func{``0}})">
|
|
5114 <!-- No matching elements were found for the following include tag --><include file="Match.xdoc" path="docs/doc[@for="Match.Create{T}(condition,renderExpression"]/*"/>
|
|
5115 </member>
|
|
5116 <member name="M:Moq.Match.SetLastMatch``1(Moq.Match{``0})">
|
|
5117 <devdoc>
|
|
5118 This method is used to set an expression as the last matcher invoked,
|
|
5119 which is used in the SetupSet to allow matchers in the prop = value
|
|
5120 delegate expression. This delegate is executed in "fluent" mode in
|
|
5121 order to capture the value being set, and construct the corresponding
|
|
5122 methodcall.
|
|
5123 This is also used in the MatcherFactory for each argument expression.
|
|
5124 This method ensures that when we execute the delegate, we
|
|
5125 also track the matcher that was invoked, so that when we create the
|
|
5126 methodcall we build the expression using it, rather than the null/default
|
|
5127 value returned from the actual invocation.
|
|
5128 </devdoc>
|
|
5129 </member>
|
|
5130 <member name="T:Moq.Match`1">
|
|
5131 <summary>
|
|
5132 Allows creation custom value matchers that can be used on setups and verification,
|
|
5133 completely replacing the built-in <see cref="T:Moq.It"/> class with your own argument
|
|
5134 matching rules.
|
|
5135 </summary><typeparam name="T">Type of the value to match.</typeparam><remarks>
|
|
5136 The argument matching is used to determine whether a concrete
|
|
5137 invocation in the mock matches a given setup. This
|
|
5138 matching mechanism is fully extensible.
|
|
5139 </remarks><example>
|
|
5140 Creating a custom matcher is straightforward. You just need to create a method
|
|
5141 that returns a value from a call to <see cref="M:Moq.Match.Create``1(System.Predicate{``0})"/> with
|
|
5142 your matching condition and optional friendly render expression:
|
|
5143 <code>
|
|
5144 [Matcher]
|
|
5145 public Order IsBigOrder()
|
|
5146 {
|
|
5147 return Match<Order>.Create(
|
|
5148 o => o.GrandTotal >= 5000,
|
|
5149 /* a friendly expression to render on failures */
|
|
5150 () => IsBigOrder());
|
|
5151 }
|
|
5152 </code>
|
|
5153 This method can be used in any mock setup invocation:
|
|
5154 <code>
|
|
5155 mock.Setup(m => m.Submit(IsBigOrder()).Throws<UnauthorizedAccessException>();
|
|
5156 </code>
|
|
5157 At runtime, Moq knows that the return value was a matcher (note that the method MUST be
|
|
5158 annotated with the [Matcher] attribute in order to determine this) and
|
|
5159 evaluates your predicate with the actual value passed into your predicate.
|
|
5160 <para>
|
|
5161 Another example might be a case where you want to match a lists of orders
|
|
5162 that contains a particular one. You might create matcher like the following:
|
|
5163 </para>
|
|
5164 <code>
|
|
5165 public static class Orders
|
|
5166 {
|
|
5167 [Matcher]
|
|
5168 public static IEnumerable<Order> Contains(Order order)
|
|
5169 {
|
|
5170 return Match<IEnumerable<Order>>.Create(orders => orders.Contains(order));
|
|
5171 }
|
|
5172 }
|
|
5173 </code>
|
|
5174 Now we can invoke this static method instead of an argument in an
|
|
5175 invocation:
|
|
5176 <code>
|
|
5177 var order = new Order { ... };
|
|
5178 var mock = new Mock<IRepository<Order>>();
|
|
5179
|
|
5180 mock.Setup(x => x.Save(Orders.Contains(order)))
|
|
5181 .Throws<ArgumentException>();
|
|
5182 </code>
|
|
5183 </example>
|
|
5184 </member>
|
|
5185 <member name="T:Moq.FluentMockContext">
|
|
5186 <summary>
|
|
5187 Tracks the current mock and interception context.
|
|
5188 </summary>
|
|
5189 </member>
|
|
5190 <member name="P:Moq.FluentMockContext.IsActive">
|
|
5191 <summary>
|
|
5192 Having an active fluent mock context means that the invocation
|
|
5193 is being performed in "trial" mode, just to gather the
|
|
5194 target method and arguments that need to be matched later
|
|
5195 when the actual invocation is made.
|
|
5196 </summary>
|
|
5197 </member>
|
|
5198 <member name="T:Moq.MockDefaultValueProvider">
|
|
5199 <summary>
|
|
5200 A <see cref="T:Moq.IDefaultValueProvider"/> that returns an empty default value
|
|
5201 for non-mockeable types, and mocks for all other types (interfaces and
|
|
5202 non-sealed classes) that can be mocked.
|
|
5203 </summary>
|
|
5204 </member>
|
|
5205 <member name="T:Moq.Mocks">
|
|
5206 <summary>
|
|
5207 Allows querying the universe of mocks for those that behave
|
|
5208 according to the LINQ query specification.
|
|
5209 </summary>
|
|
5210 <devdoc>
|
|
5211 This entry-point into Linq to Mocks is the only one in the root Moq
|
|
5212 namespace to ease discovery. But to get all the mocking extension
|
|
5213 methods on Object, a using of Moq.Linq must be done, so that the
|
|
5214 polluting of the intellisense for all objects is an explicit opt-in.
|
|
5215 </devdoc>
|
|
5216 </member>
|
|
5217 <member name="M:Moq.Mocks.Of``1">
|
|
5218 <summary>
|
|
5219 Access the universe of mocks of the given type, to retrieve those
|
|
5220 that behave according to the LINQ query specification.
|
|
5221 </summary>
|
|
5222 <typeparam name="T">The type of the mocked object to query.</typeparam>
|
|
5223 </member>
|
|
5224 <member name="M:Moq.Mocks.Of``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
|
5225 <summary>
|
|
5226 Access the universe of mocks of the given type, to retrieve those
|
|
5227 that behave according to the LINQ query specification.
|
|
5228 </summary>
|
|
5229 <param name="specification">The predicate with the setup expressions.</param>
|
|
5230 <typeparam name="T">The type of the mocked object to query.</typeparam>
|
|
5231 </member>
|
|
5232 <member name="M:Moq.Mocks.OneOf``1">
|
|
5233 <summary>
|
|
5234 Creates an mock object of the indicated type.
|
|
5235 </summary>
|
|
5236 <typeparam name="T">The type of the mocked object.</typeparam>
|
|
5237 <returns>The mocked object created.</returns>
|
|
5238 </member>
|
|
5239 <member name="M:Moq.Mocks.OneOf``1(System.Linq.Expressions.Expression{System.Func{``0,System.Boolean}})">
|
|
5240 <summary>
|
|
5241 Creates an mock object of the indicated type.
|
|
5242 </summary>
|
|
5243 <param name="specification">The predicate with the setup expressions.</param>
|
|
5244 <typeparam name="T">The type of the mocked object.</typeparam>
|
|
5245 <returns>The mocked object created.</returns>
|
|
5246 </member>
|
|
5247 <member name="M:Moq.Mocks.CreateMockQuery``1">
|
|
5248 <summary>
|
|
5249 Creates the mock query with the underlying queriable implementation.
|
|
5250 </summary>
|
|
5251 </member>
|
|
5252 <member name="M:Moq.Mocks.CreateQueryable``1">
|
|
5253 <summary>
|
|
5254 Wraps the enumerator inside a queryable.
|
|
5255 </summary>
|
|
5256 </member>
|
|
5257 <member name="M:Moq.Mocks.CreateMocks``1">
|
|
5258 <summary>
|
|
5259 Method that is turned into the actual call from .Query{T}, to
|
|
5260 transform the queryable query into a normal enumerable query.
|
|
5261 This method is never used directly by consumers.
|
|
5262 </summary>
|
|
5263 </member>
|
|
5264 <member name="M:Moq.Mocks.SetPropery``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}},``1)">
|
|
5265 <summary>
|
|
5266 Extension method used to support Linq-like setup properties that are not virtual but do have
|
|
5267 a getter and a setter, thereby allowing the use of Linq to Mocks to quickly initialize Dtos too :)
|
|
5268 </summary>
|
|
5269 </member>
|
|
5270 <member name="T:Moq.QueryableMockExtensions">
|
|
5271 <summary>
|
|
5272 Helper extensions that are used by the query translator.
|
|
5273 </summary>
|
|
5274 </member>
|
|
5275 <member name="M:Moq.QueryableMockExtensions.FluentMock``2(Moq.Mock{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})">
|
|
5276 <summary>
|
|
5277 Retrieves a fluent mock from the given setup expression.
|
|
5278 </summary>
|
|
5279 </member>
|
|
5280 <member name="M:Moq.Proxy.IProxyFactory.GetDelegateProxyInterface(System.Type,System.Reflection.MethodInfo@)">
|
|
5281 <summary>
|
|
5282 Gets an autogenerated interface with a method on it that matches the signature of the specified
|
|
5283 <paramref name="delegateType"/>.
|
|
5284 </summary>
|
|
5285 <remarks>
|
|
5286 Such an interface can then be mocked, and a delegate pointed at the method on the mocked instance.
|
|
5287 This is how we support delegate mocking. The factory caches such interfaces and reuses them
|
|
5288 for repeated requests for the same delegate type.
|
|
5289 </remarks>
|
|
5290 <param name="delegateType">The delegate type for which an interface is required.</param>
|
|
5291 <param name="delegateInterfaceMethod">The method on the autogenerated interface.</param>
|
|
5292 </member>
|
|
5293 <member name="M:Moq.Proxy.CastleProxyFactory.CreateProxy(System.Type,Moq.Proxy.ICallInterceptor,System.Type[],System.Object[])">
|
|
5294 <inheritdoc />
|
|
5295 </member>
|
|
5296 <member name="M:Moq.Proxy.CastleProxyFactory.GetDelegateProxyInterface(System.Type,System.Reflection.MethodInfo@)">
|
|
5297 <inheritdoc />
|
|
5298 </member>
|
|
5299 <member name="T:Moq.Times">
|
|
5300 <summary>
|
|
5301 Defines the number of invocations allowed by a mocked method.
|
|
5302 </summary>
|
|
5303 </member>
|
|
5304 <member name="M:Moq.Times.AtLeast(System.Int32)">
|
|
5305 <summary>
|
|
5306 Specifies that a mocked method should be invoked <paramref name="callCount"/> times as minimum.
|
|
5307 </summary><param name="callCount">The minimun number of times.</param><returns>An object defining the allowed number of invocations.</returns>
|
|
5308 </member>
|
|
5309 <member name="M:Moq.Times.AtLeastOnce">
|
|
5310 <summary>
|
|
5311 Specifies that a mocked method should be invoked one time as minimum.
|
|
5312 </summary><returns>An object defining the allowed number of invocations.</returns>
|
|
5313 </member>
|
|
5314 <member name="M:Moq.Times.AtMost(System.Int32)">
|
|
5315 <summary>
|
|
5316 Specifies that a mocked method should be invoked <paramref name="callCount"/> time as maximun.
|
|
5317 </summary><param name="callCount">The maximun number of times.</param><returns>An object defining the allowed number of invocations.</returns>
|
|
5318 </member>
|
|
5319 <member name="M:Moq.Times.AtMostOnce">
|
|
5320 <summary>
|
|
5321 Specifies that a mocked method should be invoked one time as maximun.
|
|
5322 </summary><returns>An object defining the allowed number of invocations.</returns>
|
|
5323 </member>
|
|
5324 <member name="M:Moq.Times.Between(System.Int32,System.Int32,Moq.Range)">
|
|
5325 <summary>
|
|
5326 Specifies that a mocked method should be invoked between <paramref name="callCountFrom"/> and
|
|
5327 <paramref name="callCountTo"/> times.
|
|
5328 </summary><param name="callCountFrom">The minimun number of times.</param><param name="callCountTo">The maximun number of times.</param><param name="rangeKind">
|
|
5329 The kind of range. See <see cref="T:Moq.Range"/>.
|
|
5330 </param><returns>An object defining the allowed number of invocations.</returns>
|
|
5331 </member>
|
|
5332 <member name="M:Moq.Times.Exactly(System.Int32)">
|
|
5333 <summary>
|
|
5334 Specifies that a mocked method should be invoked exactly <paramref name="callCount"/> times.
|
|
5335 </summary><param name="callCount">The times that a method or property can be called.</param><returns>An object defining the allowed number of invocations.</returns>
|
|
5336 </member>
|
|
5337 <member name="M:Moq.Times.Never">
|
|
5338 <summary>
|
|
5339 Specifies that a mocked method should not be invoked.
|
|
5340 </summary><returns>An object defining the allowed number of invocations.</returns>
|
|
5341 </member>
|
|
5342 <member name="M:Moq.Times.Once">
|
|
5343 <summary>
|
|
5344 Specifies that a mocked method should be invoked exactly one time.
|
|
5345 </summary><returns>An object defining the allowed number of invocations.</returns>
|
|
5346 </member>
|
|
5347 <member name="M:Moq.Times.Equals(System.Object)">
|
|
5348 <summary>
|
|
5349 Determines whether the specified <see cref="T:System.Object"/> is equal to this instance.
|
|
5350 </summary><param name="obj">
|
|
5351 The <see cref="T:System.Object"/> to compare with this instance.
|
|
5352 </param><returns>
|
|
5353 <c>true</c> if the specified <see cref="T:System.Object"/> is equal to this instance; otherwise, <c>false</c>.
|
|
5354 </returns>
|
|
5355 </member>
|
|
5356 <member name="M:Moq.Times.GetHashCode">
|
|
5357 <summary>
|
|
5358 Returns a hash code for this instance.
|
|
5359 </summary><returns>
|
|
5360 A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
|
|
5361 </returns>
|
|
5362 </member>
|
|
5363 <member name="M:Moq.Times.op_Equality(Moq.Times,Moq.Times)">
|
|
5364 <summary>
|
|
5365 Determines whether two specified <see cref="T:Moq.Times"/> objects have the same value.
|
|
5366 </summary><param name="left">
|
|
5367 The first <see cref="T:Moq.Times"/>.
|
|
5368 </param><param name="right">
|
|
5369 The second <see cref="T:Moq.Times"/>.
|
|
5370 </param><returns>
|
|
5371 <c>true</c> if the value of left is the same as the value of right; otherwise, <c>false</c>.
|
|
5372 </returns>
|
|
5373 </member>
|
|
5374 <member name="M:Moq.Times.op_Inequality(Moq.Times,Moq.Times)">
|
|
5375 <summary>
|
|
5376 Determines whether two specified <see cref="T:Moq.Times"/> objects have different values.
|
|
5377 </summary><param name="left">
|
|
5378 The first <see cref="T:Moq.Times"/>.
|
|
5379 </param><param name="right">
|
|
5380 The second <see cref="T:Moq.Times"/>.
|
|
5381 </param><returns>
|
|
5382 <c>true</c> if the value of left is different from the value of right; otherwise, <c>false</c>.
|
|
5383 </returns>
|
|
5384 </member>
|
|
5385 </members>
|
|
5386 </doc>
|