示例#1
0
        public void IfNotNull_NotNull_ExecutesTheFunction()
        {
            //Arrange
            var testObject = new TestObject();

            var result = new object();

            // Act
            testObject.IfNotNull(t => result = null);

            // Assert
            result.Should().BeNull();
        }
示例#2
0
        public void IfNotNull_Null_DoesNothing()
        {
            //Arrange
            TestObject testObject = null;

            var result = new object();

            // Act
            testObject.IfNotNull(o => result = null);

            // Assert
            result.Should().NotBeNull();
        }