Example #1
0
        public void IgnoringPropertyDoesNotWriteLogWhenDisabled()
        {
            var propertyInfo = typeof(Person).GetProperty(nameof(Person.FirstName)) !;
            var context      = new Person();

            var sut = new DefaultBuildLog();

            sut.IgnoringProperty(propertyInfo, context);

            sut.Output.Should().BeEmpty();
        }
Example #2
0
        public void IgnoringPropertyThrowsExceptionWithNullContext()
        {
            var propertyInfo = typeof(Person).GetProperty(nameof(Person.FirstName)) !;

            var sut = new DefaultBuildLog {
                IsEnabled = true
            };

            Action action = () => sut.IgnoringProperty(propertyInfo, null !);

            action.Should().Throw <ArgumentNullException>();
        }
Example #3
0
        public void IgnoringPropertyAppendsLogEntry()
        {
            var propertyInfo = typeof(Person).GetProperty(nameof(Person.FirstName)) !;
            var context      = new Person();

            var sut = new DefaultBuildLog {
                IsEnabled = true
            };

            sut.IgnoringProperty(propertyInfo, context);

            sut.Output.Should().NotBeNullOrWhiteSpace();
        }