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.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
### 6.x (work in progress)
2
+
3
+
*[UPDATE] Update target frameworks: .NET8, .NET Standard 2.0
4
+
*[UPDATE] Drop EOL .NET 6/7 platforms from testing matrix
5
+
*[UPDATE] Update github actions steps versions
6
+
*[UPDATE] Remove legacy obsolete API
7
+
*[UPDATE] Mark as obsolete api CompatArg with pre c# 7.0 support
8
+
9
+
1
10
### 5.3.0 (October 2024)
2
11
3
12
*[NEW] Introduced `Substitute.ForTypeForwardingTo` to create substitutes that forward interceptable calls to a concrete class. This provides an easy way of implementing a test spy over an existing type. Designed and implemented by @marcoregueira in https://github.com/nsubstitute/NSubstitute/pull/700 from a proposal by @wsaeed. Thanks to all who contributed to discussions of this feature.
@@ -40,7 +49,7 @@ Many thanks to @alexandrnikitin, @Romfos, @brad, and @304NotModified for their c
40
49
41
50
### 4.4.0 (Jul 2022)
42
51
43
-
*[FIX] Fix issue checking for constructor args on null object. Thanks to @phongphanq, and @appel1! Thanks also to
52
+
*[FIX] Fix issue checking for constructor args on null object. Thanks to @phongphanq, and @appel1! Thanks also to
44
53
@Mandroide for code review. (#683, #685)
45
54
*[UPDATE] Update to Castle Core v5. Thanks @Havunen! (#690, #673)
46
55
*[NEW] Add `.ThrowsAsync()` that will correctly mock exception on async methods. Thanks @Socolin! (#609, #663)
Copy file name to clipboardExpand all lines: src/NSubstitute/Compatibility/DiagnosticsNullabilityAttributes.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
#if !SYSTEM_DIAGNOSTICS_CODEANALYSIS_NULLABILITY
1
+
#if NETSTANDARD2_0
2
2
3
3
// This was copied from https://github.com/dotnet/runtime/blob/39b9607807f29e48cae4652cd74735182b31182e/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs
4
4
// and updated to have the scope of the attributes be internal.
0 commit comments