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
* Removed a bunch of obsolete and unused methods
* Consolidate Intercept methods, and add the new AssertThrows
* Fixed a few tests that where dealing with the AggregateExceptions themselves
/// Intercept and return an exception that's expected to be thrown by the passed function value. The thrown
141
+
/// exception must be an instance of the type specified by the type parameter of this method. This method
142
+
/// invokes the passed function. If the function throws an exception that's an instance of the specified type,
143
+
/// this method returns that exception. Else, whether the passed function returns normally or completes abruptly
144
+
/// with a different exception, this method throws <see cref="ThrowsException"/>.
145
+
/// <para>
146
+
/// Also note that the difference between this method and <seealso cref="AssertThrows{T}"/> is that this method
147
+
/// returns the expected exception, so it lets you perform further assertions on that exception. By contrast,
148
+
/// the <seealso cref="AssertThrows{T}"/> indicates to the reader of the code that nothing further is expected
149
+
/// about the thrown exception other than its type. The recommended usage is to use <seealso cref="AssertThrows{T}"/>
150
+
/// by default, intercept only when you need to inspect the caught exception further.
151
+
/// </para>
152
+
/// </summary>
153
+
/// <param name="actionThatThrows">The action that should throw the expected exception</param>
154
+
/// <returns>The intercepted exception, if it is of the expected type</returns>
155
+
/// <exception cref="ThrowsException">If the passed action does not complete abruptly with an exception that's an instance of the specified type.</exception>
/// Ensure that an expected exception is thrown by the passed function value. The thrown exception must be an
179
+
/// instance of the type specified by the type parameter of this method. This method invokes the passed
180
+
/// function. If the function throws an exception that's an instance of the specified type, this method returns
181
+
/// void. Else, whether the passed function returns normally or completes abruptly with a different
182
+
/// exception, this method throws <see cref="ThrowsException"/>.
183
+
/// <para>
184
+
/// Also note that the difference between this method and <seealso cref="Intercept{T}"/> is that this method
185
+
/// does not return the expected exception, so it does not let you perform further assertions on that exception.
186
+
/// It also indicates to the reader of the code that nothing further is expected about the thrown exception
187
+
/// other than its type. The recommended usage is to use <see cref="AssertThrows{T}"/> by default,
188
+
/// <seealso cref="Intercept{T}"/> only when you need to inspect the caught exception further.
189
+
/// </para>
190
+
/// </summary>
191
+
/// <param name="actionThatThrows">The action that should throw the expected exception</param>
192
+
/// <exception cref="ThrowsException">If the passed action does not complete abruptly with an exception that's an instance of the specified type.</exception>
0 commit comments