You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Substitutes will now automatically return an empty `IQueryable<T>` for
115
122
members that return that type. Tests previously relying on a
116
123
substitute `IQueryable<T>` will no longer work properly.
117
124
118
125
Reason:
119
-
- Code that uses an `IQueryable<T>` can now run using the auto-subbed
126
+
- Code that uses an `IQueryable<T>` can now run using the auto-subbed
120
127
value without causing null pointer exceptions (see issue #67).
121
128
122
129
Fix:
@@ -128,10 +135,10 @@ to return a real `IQueryable<T>` instead. If a substitute is required, explicitl
128
135
```
129
136
130
137
131
-
1.9.1 Release
138
+
1.9.1 Release
132
139
================
133
140
134
-
Substitutes set up to throw exception for methods with return type Task<T>
141
+
Substitutes set up to throw exception for methods with return type Task<T>
135
142
cause compilation to fail due to the call being ambiguous (CS0121).
136
143
"The call is ambiguous between the following methods or properties:
137
144
`.Returns<Task<T>>` and `.Returns<T>`"
@@ -146,7 +153,7 @@ Fix:
146
153
147
154
New: `sub.Method().Returns<string>(x => { throw new Exception() });`
148
155
149
-
1.8.0 Release
156
+
1.8.0 Release
150
157
================
151
158
152
159
Incorrect use of argument matchers outside of a member call, particularly within a
@@ -214,7 +221,7 @@ Fix:
214
221
215
222
---------------
216
223
217
-
In rare cases the new `Returns()` and `ReturnsForAnyArgs()` overloads can cause compilation to fail due to the call being ambiguous (CS0121).
224
+
In rare cases the new `Returns()` and `ReturnsForAnyArgs()` overloads can cause compilation to fail due to the call being ambiguous (CS0121).
218
225
219
226
Reason:
220
227
- The new overloads allow a sequence of callbacks to be used for return values. A common example is return several values, then throwing an exception.
@@ -229,7 +236,7 @@ Fix:
229
236
Auto-substitute from substitutes of `Func` delegates (following the same rules as auto-subbing for methods and properties). So the delegate returned from `Substitute.For<Func<IFoo>>()` will return a substitute of `IFoo`. This means some substitutes for delegates that used to return null will now return a new substitute.
230
237
231
238
Reason:
232
-
- Reduced setup when substituting for `Func` delegates, and consistency with behaviour for properties and methods.
239
+
- Reduced setup when substituting for `Func` delegates, and consistency with behaviour for properties and methods.
233
240
234
241
Fix:
235
242
- Explicitly return null from substitute delegates when required for a test.
0 commit comments