public void IfNotNull_NotNull_ExecutesTheFunction() { //Arrange var testObject = new TestObject(); var result = new object(); // Act testObject.IfNotNull(t => result = null); // Assert result.Should().BeNull(); }
public void IfNotNull_Null_DoesNothing() { //Arrange TestObject testObject = null; var result = new object(); // Act testObject.IfNotNull(o => result = null); // Assert result.Should().NotBeNull(); }