Ejemplo n.º 1
0
        public void ComposeSingleItemReturnsCorrectResult()
        {
            // Arrange
            var dummyBuilder = new DelegatingSpecimenBuilder();
            var sut          = new DisposableTracker(dummyBuilder);
            // Act
            var expected = new DelegatingSpecimenBuilder();
            var actual   = sut.Compose(new[] { expected });
            // Assert
            var dt = Assert.IsAssignableFrom <DisposableTracker>(actual);

            Assert.Equal(expected, dt.Builder);
        }
Ejemplo n.º 2
0
        public void ComposeSingleItemReturnsCorrectResult()
        {
            // Fixture setup
            var dummyBuilder = new DelegatingSpecimenBuilder();
            var sut          = new DisposableTracker(dummyBuilder);
            // Exercise system
            var expected = new DelegatingSpecimenBuilder();
            var actual   = sut.Compose(new[] { expected });
            // Verify outcome
            var dt = Assert.IsAssignableFrom <DisposableTracker>(actual);

            Assert.Equal(expected, dt.Builder);
            // Teardown
        }
Ejemplo n.º 3
0
        public void ComposeAddsReturnedObjectToDisposables()
        {
            // Arrange
            var dummy = new DelegatingSpecimenBuilder();
            var sut   = new DisposableTracker(dummy);
            // Act
            var dummies = new ISpecimenBuilder[0];
            var actual  = sut.Compose(dummies);

            // Assert
            Assert.True(
                sut.Disposables.Any(actual.Equals),
                "Returned value not added to disposables.");
        }
Ejemplo n.º 4
0
        public void ComposeAddsReturnedObjectToDisposables()
        {
            // Fixture setup
            var dummy = new DelegatingSpecimenBuilder();
            var sut   = new DisposableTracker(dummy);
            // Exercise system
            var dummies = new ISpecimenBuilder[0];
            var actual  = sut.Compose(dummies);

            // Verify outcome
            Assert.True(
                sut.Disposables.Any(actual.Equals),
                "Returned value not added to disposables.");
            // Teardown
        }
Ejemplo n.º 5
0
        public void ComposeReturnsCorrectResult()
        {
            // Arrange
            var dummyBuilder = new DelegatingSpecimenBuilder();
            var sut          = new DisposableTracker(dummyBuilder);
            // Act
            var expectedBuilders = new[]
            {
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder()
            };
            var actual = sut.Compose(expectedBuilders);
            // Assert
            var dt        = Assert.IsAssignableFrom <DisposableTracker>(actual);
            var composite = Assert.IsAssignableFrom <CompositeSpecimenBuilder>(dt.Builder);

            Assert.True(expectedBuilders.SequenceEqual(composite));
        }
Ejemplo n.º 6
0
        public void ComposeReturnsCorrectResult()
        {
            // Fixture setup
            var dummyBuilder = new DelegatingSpecimenBuilder();
            var sut          = new DisposableTracker(dummyBuilder);
            // Exercise system
            var expectedBuilders = new[]
            {
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder(),
                new DelegatingSpecimenBuilder()
            };
            var actual = sut.Compose(expectedBuilders);
            // Verify outcome
            var dt        = Assert.IsAssignableFrom <DisposableTracker>(actual);
            var composite = Assert.IsAssignableFrom <CompositeSpecimenBuilder>(dt.Builder);

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