And<T>(T, Action<T>) Method

Performs the specified action on the given object and then returns the object. Useful for fluent testing patterns where additional assertions or operations are chained together in a readable manner.
[DebuggerStepThrough]
public static T And<T>(this T item, Action<T> action)
Containing Type
ShouldlyExtensions

Attributes

DebuggerStepThroughAttribute

Parameters

T
The type of the object.

Parameters

T item
The object to operate on.
Action<T> action
An action to perform on the object.

Returns

T