Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

Commented Issue: "".Should().StartWith should not throw System.ArgumentOutOfRangeException [12293]

$
0
0
When the asserting if a string starts with a specific string, but the first string is shorter in lenght, an ArgumentOutOfRange exception is throw.

Example:
"ABCDEFG".Should().StartWith("ABCDEFGHIJKLMN");

Result:
System.ArgumentOutOfRangeException: StartIndex cannot be less than zero.

Expected:
AssertFailedException with message.
Comments: Associated with changeset 79522: Fixed ArgumentOutOfRangeException when expected string in StartWith assertion was longer than the actual string.

Viewing all articles
Browse latest Browse all 1402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>