Exemplo n.º 1
0
        public void AttributesContainsAttributeWhenConstructedWithExplicitAutoDataAttribute()
        {
            // Arrange
            var autoDataAttribute = new AutoDataAttribute();
            var sut = new DerivedInlineAutoDataAttribute(autoDataAttribute);
            // Act
            var result = sut.Attributes;

            // Assert
            Assert.Contains(autoDataAttribute, result);
        }
Exemplo n.º 2
0
        public void AutoDataAttributeIsCorrectWhenCreatedExplicitlyByConstructor()
        {
            // Arrange
            var expected = new AutoDataAttribute();
            var sut      = new DerivedInlineAutoDataAttribute(expected);
            // Act
            var result = sut.AutoDataAttribute;

            // Assert
            Assert.Equal(expected, result);
        }
        public void AttributesContainsAttributeWhenConstructedWithExplicitAutoDataAttribute()
        {
            // Fixture setup
            var autoDataAttribute = new AutoDataAttribute();
            var sut = new DerivedInlineAutoDataAttribute(autoDataAttribute);
            // Exercise system
            var result = sut.Attributes;

            // Verify outcome
            Assert.Contains(autoDataAttribute, result);
            // Teardown
        }
        public void AutoDataAttributeIsCorrectWhenCreatedExplicitlyByConstructor()
        {
            // Fixture setup
            var expected = new AutoDataAttribute();
            var sut      = new DerivedInlineAutoDataAttribute(expected);
            // Exercise system
            var result = sut.AutoDataAttribute;

            // Verify outcome
            Assert.Equal(expected, result);
            // Teardown
        }
Exemplo n.º 5
0
        public void ValuesAreCorrectWhenConstructedWithExplicitAutoDataAttribute()
        {
            // Arrange
            var dummyAutoDataAttribute = new AutoDataAttribute();
            var expectedValues         = new[] { new object(), new object(), new object() };
            var sut = new DerivedInlineAutoDataAttribute(dummyAutoDataAttribute, expectedValues);
            // Act
            var result = sut.Values;

            // Assert
            Assert.True(expectedValues.SequenceEqual(result));
        }
        public void ValuesAreCorrectWhenConstructedWithExplicitAutoDataAttribute()
        {
            // Fixture setup
            var dummyAutoDataAttribute = new AutoDataAttribute();
            var expectedValues         = new[] { new object(), new object(), new object() };
            var sut = new DerivedInlineAutoDataAttribute(dummyAutoDataAttribute, expectedValues);
            // Exercise system
            var result = sut.Values;

            // Verify outcome
            Assert.True(expectedValues.SequenceEqual(result));
            // Teardown
        }
Exemplo n.º 7
0
        public void DoesntActivateFixtureImmediately()
        {
            // Arrange
            bool wasInvoked = false;
            var  autoData   = new DerivedAutoDataAttribute(() =>
            {
                wasInvoked = true;
                return(null);
            });

            // Act
            var sut = new DerivedInlineAutoDataAttribute(autoData);

            // Assert
            Assert.False(wasInvoked);
        }
        public void DoesntActivateFixtureImmediately()
        {
            // Fixture setup
            bool wasInvoked = false;
            var  autoData   = new DerivedAutoDataAttribute(() =>
            {
                wasInvoked = true;
                return(null);
            });

            // Exercise system
            var sut = new DerivedInlineAutoDataAttribute(autoData);

            // Verify outcome
            Assert.False(wasInvoked);
            // Teardown
        }