Skip to content

StringAssertions.HaveLength Method ​

Definition ​

Asserts that the string has the specified length.

c#
public AssertionsChain<StringAssertions, string> HaveLength(int expected);

View source

Parameters ​

NameTypeDescription
expectedInt32The expected length.

Returns ​

AssertionsChain<StringAssertions, String>

An AssertionsChain<TAssertions, T> for chaining further assertions.