public void ThrowExceptionIfStringIsInvalid_WithValidStrings_ShouldNotThrow_ArgumentException(string toCheck) { //Act Action act = () => StringArgumentChecking.ThrowExceptionIfStringIsInvalid(toCheck, nameof(toCheck)); //Assert act.Should().NotThrow(); }
public void ThrowExceptionIfStringIsInvalid_WithInvalidStrings_ShouldThrow_ArgumentException(string toCheck) { //Act Action act = () => StringArgumentChecking.ThrowExceptionIfStringIsInvalid(toCheck, nameof(toCheck)); //Assert act.Should().ThrowExactly <ArgumentException>().Where(e => e.Message.Contains(nameof(toCheck))); }