Skip to content

ShouldExtensions Class ​

Definition ​

Extension methods that provide the primary entry point for fluent assertions via .Should().

c#
public static class ShouldExtensions

View source

Methods ​

NameDescription
Should<T>(T)Begins a fluent assertion on the specified value.
Should(Boolean)Begins a fluent assertion on the specified boolean value.
Should(String)Begins a fluent assertion on the specified string value.
Should(Exception)Begins a fluent assertion on the specified exception.
Should(ArgumentException)Begins a fluent assertion on the specified ArgumentException.
Should(ArgumentOutOfRangeException)Begins a fluent assertion on the specified ArgumentOutOfRangeException.
Should<T>(IEnumerable<T>)Begins a fluent assertion on the specified enumerable.
Should<TKey, TValue>(IReadOnlyDictionary<TKey, TValue>)Begins a fluent assertion on the specified read-only dictionary.
Should<TKey, TValue>(Dictionary<TKey, TValue>)Begins a fluent assertion on the specified dictionary.
Should<T>(IReadOnlySet<T>)Begins a fluent assertion on the specified read-only set.
Should<T>(HashSet<T>)Begins a fluent assertion on the specified hash set.
Should<T>(Span<T>)Begins a fluent assertion on the specified span.
Should<T>(ReadOnlySpan<T>)Begins a fluent assertion on the specified read-only span.
Should(Action)Begins a fluent assertion on the specified action.
Should(Func<Task>)Begins a fluent assertion on the specified async action.
Should(Byte)Begins a fluent assertion on the specified byte value.
Should(SByte)Begins a fluent assertion on the specified sbyte value.
Should(Int16)Begins a fluent assertion on the specified short value.
Should(UInt16)Begins a fluent assertion on the specified ushort value.
Should(Int32)Begins a fluent assertion on the specified int value.
Should(UInt32)Begins a fluent assertion on the specified uint value.
Should(Int64)Begins a fluent assertion on the specified long value.
Should(UInt64)Begins a fluent assertion on the specified ulong value.
Should(IntPtr)Begins a fluent assertion on the specified nint value.
Should(UIntPtr)Begins a fluent assertion on the specified nuint value.
Should(Decimal)Begins a fluent assertion on the specified decimal value.
Should(TimeSpan)Begins a fluent assertion on the specified TimeSpan value.
Should(DateTimeOffset)Begins a fluent assertion on the specified DateTimeOffset value.
Should(DateOnly)Begins a fluent assertion on the specified DateOnly value.
Should(Single)Begins a fluent assertion on the specified float value.
Should(Double)Begins a fluent assertion on the specified double value.
Should(Half)Begins a fluent assertion on the specified Half value.