public void InheritedClassAttribute_ExecutesTypesInSetup()
        {
            // Arrange
            var attribute = new DependantAttribute();
            var mock      = new TypeInfoMock(typeof(Child));

            // Act
            var results = attribute.BuildFrom(mock);

            Assert.IsNotEmpty(results);
            foreach (var result in results)
            {
                // Assert
                Assert.AreEqual(RunState.Ignored, result.RunState);
            }
        }
Exemplo n.º 2
0
        public void ValidType_GetsExecuted(Type executable, Type test, RunState runstate)
        {
            // Arrange
            var attribute = new DependantAttribute(executable);
            var mock      = new TypeInfoMock(test);

            // Act
            var results = attribute.BuildFrom(mock);

            Assert.IsNotEmpty(results);
            foreach (var result in results)
            {
                // Assert
                Assert.AreEqual(runstate, result.RunState);
            }
        }
Exemplo n.º 3
0
        public void ExecuteInSetupTrue_ExecutesParameters(Type test, RunState runstate)
        {
            // Arrange
            var attribute = new DependantAttribute(true);
            var mock      = new TypeInfoMock(test);

            // Act
            var results = attribute.BuildFrom(mock);

            Assert.IsNotEmpty(results);
            foreach (var result in results)
            {
                // Assert
                Assert.AreEqual(runstate, result.RunState);
            }
        }
Exemplo n.º 4
0
        public void InvalidTypeSpecified_CreatesInvalidTestFixture(params Type[] types)
        {
            // Arrange
            var attribute = new DependantAttribute(types);
            var mock      = new TypeInfoMock(typeof(ExecuteInSetupTests));

            // Act
            var results = attribute.BuildFrom(mock);

            Assert.IsNotEmpty(results);
            foreach (var result in results)
            {
                // Assert
                Assert.AreEqual(RunState.NotRunnable, result.RunState);
            }
        }