예제 #1
0
        public void PopulatedInstanceDoesNotWriteLogWhenDisabled()
        {
            var instance = new Person();

            var sut = new DefaultBuildLog();

            sut.PopulatedInstance(instance);

            sut.Output.Should().BeEmpty();
        }
예제 #2
0
        public void PopulatedInstanceAppendsLogEntry()
        {
            var instance = new Person();

            var sut = new DefaultBuildLog {
                IsEnabled = true
            };

            sut.PopulatedInstance(instance);

            sut.Output.Should().NotBeNullOrWhiteSpace();
        }
예제 #3
0
        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 PopulatedInstanceThrowsExceptionWithNullInstanceTest()
        {
            var target = new DefaultBuildLog();

            Action action = () => target.PopulatedInstance(null);

            action.ShouldThrow<ArgumentNullException>();
        }
        public void PopulatedInstanceAppendsLogEntryTest()
        {
            var instance = new Person();

            var target = new DefaultBuildLog();

            target.PopulatedInstance(instance);

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