public void CreatedPropertyDoesNotWriteLogWhenDisabled() { var propertyInfo = typeof(Person).GetProperty(nameof(Person.FirstName)) !; var context = new Person(); var sut = new DefaultBuildLog(); sut.CreatedProperty(propertyInfo, context); sut.Output.Should().BeEmpty(); }
public void CreatedPropertyThrowsExceptionWithNullContext() { var propertyInfo = typeof(Person).GetProperty(nameof(Person.FirstName)) !; var sut = new DefaultBuildLog { IsEnabled = true }; Action action = () => sut.CreatedProperty(propertyInfo, null !); action.Should().Throw <ArgumentNullException>(); }
public void CreatedPropertyAppendsLogEntry() { var propertyInfo = typeof(Person).GetProperty(nameof(Person.FirstName)) !; var context = new Person(); var sut = new DefaultBuildLog { IsEnabled = true }; sut.CreatedProperty(propertyInfo, context); sut.Output.Should().NotBeNullOrWhiteSpace(); }