Exemple #1
0
        public void ComposeSingleItemReturnsCorrectResult()
        {
            // Arrange
            var writer = TextWriter.Null;
            var tracer = new DelegatingTracingBuilder();
            var sut    = new TraceWriter(writer, tracer);
            // Act
            var expected = new DelegatingSpecimenBuilder();
            var actual   = sut.Compose(new[] { expected });
            // Assert
            var tw = Assert.IsAssignableFrom <TraceWriter>(actual);

            Assert.Equal(expected, tw.Tracer.Builder);
        }
Exemple #2
0
        public void ComposeSingleItemReturnsCorrectResult()
        {
            // Fixture setup
            var writer = TextWriter.Null;
            var tracer = new DelegatingTracingBuilder();
            var sut    = new TraceWriter(writer, tracer);
            // Exercise system
            var expected = new DelegatingSpecimenBuilder();
            var actual   = sut.Compose(new[] { expected });
            // Verify outcome
            var tw = Assert.IsAssignableFrom <TraceWriter>(actual);

            Assert.Equal(expected, tw.Tracer.Builder);
            // Teardown
        }
Exemple #3
0
        public void ComposeReturnsCorrectResult()
        {
            // Arrange
            var writer = TextWriter.Null;
            var tracer = new DelegatingTracingBuilder();
            var sut    = new TraceWriter(writer, tracer);
            // Act
            var expectedBuilders = new[]
            {
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder()
            };
            var actual = sut.Compose(expectedBuilders);
            // Assert
            var tw        = Assert.IsAssignableFrom <TraceWriter>(actual);
            var composite = Assert.IsAssignableFrom <CompositeSpecimenBuilder>(tw.Tracer.Builder);

            Assert.True(expectedBuilders.SequenceEqual(composite));
        }
Exemple #4
0
        public void ComposeReturnsCorrectResult()
        {
            // Fixture setup
            var writer = TextWriter.Null;
            var tracer = new DelegatingTracingBuilder();
            var sut    = new TraceWriter(writer, tracer);
            // Exercise system
            var expectedBuilders = new []
            {
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder()
            };
            var actual = sut.Compose(expectedBuilders);
            // Verify outcome
            var tw        = Assert.IsAssignableFrom <TraceWriter>(actual);
            var composite = Assert.IsAssignableFrom <CompositeSpecimenBuilder>(tw.Tracer.Builder);

            Assert.True(expectedBuilders.SequenceEqual(composite));
            // Teardown
        }