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); }
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 }
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)); }
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 }