public void CreatingValueDoesNotWriteLogWhenDisabled() { var generatorType = typeof(StateValueGenerator); var type = typeof(string); var sut = new DefaultBuildLog(); sut.CreatingValue(type, generatorType, null !); sut.Output.Should().BeEmpty(); }
public void CreatingValueThrowsExceptionWithNullGeneratorType() { var type = typeof(string); var sut = new DefaultBuildLog { IsEnabled = true }; Action action = () => sut.CreatingValue(type, null !, null !); action.Should().Throw <ArgumentNullException>(); }
public void ClearRemovesExistingBuildLogDataTest() { var target = new DefaultBuildLog(); target.CreatingValue(typeof(string), null); target.Output.Should().NotBeNullOrWhiteSpace(); target.Clear(); target.Output.Should().BeNullOrWhiteSpace(); }
public void CreatingValueAppendsLogEntry() { var generatorType = typeof(StateValueGenerator); var type = typeof(string); var sut = new DefaultBuildLog { IsEnabled = true }; sut.CreatingValue(type, generatorType, null !); sut.Output.Should().NotBeNullOrWhiteSpace(); }
public void ClearRemovesExistingBuildLogData() { var generatorType = typeof(StateValueGenerator); var type = typeof(string); var sut = new DefaultBuildLog { IsEnabled = true }; sut.CreatingValue(type, generatorType, null !); sut.Output.Should().NotBeNullOrWhiteSpace(); sut.Clear(); sut.Output.Should().BeNullOrWhiteSpace(); }
public void CreateTypeIndentsChildMessages() { var generatorType = typeof(StateValueGenerator); var creatorType = typeof(DefaultTypeCreator); var sut = new DefaultBuildLog { IsEnabled = true }; sut.CreatingType(typeof(Person), creatorType, null !); sut.CreatingValue(typeof(string), generatorType, null !); sut.CreatedType(typeof(Person), null !); var actual = sut.Output; actual.Should().Contain(" "); }
public void PopulateInstanceIndentsChildMessages() { var generatorType = typeof(StateValueGenerator); var type = typeof(string); var instance = new Person(); var sut = new DefaultBuildLog { IsEnabled = true }; sut.PopulatingInstance(instance); sut.CreatingValue(type, generatorType, null !); sut.PopulatedInstance(instance); var actual = sut.Output; actual.Should().Contain(" "); }
public void PopulateInstanceIndentsChildMessagesTest() { var instance = new Person(); var target = new DefaultBuildLog(); target.PopulatingInstance(instance); target.CreatingValue(typeof(string), null); target.PopulatedInstance(instance); var actual = target.Output; actual.Should().Contain(" "); }
public void CreatingValueThrowsExceptionWithNullValueTest() { var target = new DefaultBuildLog(); Action action = () => target.CreatingValue(null, null); action.ShouldThrow<ArgumentNullException>(); }
public void CreatingValueAppendsLogEntryTest() { var target = new DefaultBuildLog(); target.CreatingValue(typeof(string), null); target.Output.Should().NotBeNullOrWhiteSpace(); }
public void CreateTypeIndentsChildMessagesTest() { var target = new DefaultBuildLog(); target.CreatingType(typeof(Person), null); target.CreatingValue(typeof(string), null); target.CreatedType(typeof(Person), null); var actual = target.Output; actual.Should().Contain(" "); }