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