public void ThrowExceptionIfNull_WithNullArguments_ShouldThrow_ArgumentNullException() { //Act Action act = () => NullChecking.ThrowExceptionIfNull(null, "Something"); //Assert act.Should().ThrowExactly <ArgumentNullException>().Where(e => e.Message.Contains("Something")); }
public void ThrowExceptionIfNull_WithGoodArguments_ShouldNotThrow_ArgumentNullException() { //Act Action act = () => NullChecking.ThrowExceptionIfNull(new object(), "Something"); //Assert act.Should().NotThrow(); }
public void ThrowExceptionIfNullOrContainsNull_WithNullArguments_ShouldNotThrow_ArgumentNullException() { //Act Action act = () => NullChecking.ThrowExceptionIfNullOrContainsNull(new List <object> { new object(), null }, "Something interesting"); //Assert act.Should().ThrowExactly <ArgumentNullException>().Where(e => e.Message.Contains("Something interesting")); }