Ejemplo n.º 1
0
    public IEnumerable <ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
    {
        EnumerateTestCommands__Called    = true;
        EnumerateTestCommands_TestMethod = testMethod;

        return(EnumerateTestCommands__Result ?? testClassCommand.EnumerateTestCommands(testMethod));
    }
Ejemplo n.º 2
0
            public void SettingSkipReasonGeneratesSkipCommand()
            {
                MethodInfo       method       = typeof(ClassWithSkippedTest).GetMethod("SkippedTest");
                TestClassCommand classCommand = new TestClassCommand(typeof(ClassWithSkippedTest));

                var commands = new List <ITestCommand>(classCommand.EnumerateTestCommands(Reflector.Wrap(method)));

                ITestCommand command     = Assert.Single(commands);
                SkipCommand  skipCommand = Assert.IsType <SkipCommand>(command);

                Assert.Equal("My Skip Reason", skipCommand.Reason);
            }
        public IEnumerable <ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
        {
            foreach (var testCommand in _cmd.EnumerateTestCommands(testMethod))
            {
                if (testCommand is MediumTrustTestCommand)
                {
                    yield return(testCommand);

                    continue;
                }

                yield return(new MediumTrustTestCommand(testCommand, null));
            }
        }
        public IEnumerable <ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
        {
            foreach (var attr in testMethod.GetCustomAttributes(typeof(FactAttribute)))
            {
                if (!String.IsNullOrEmpty(attr.GetPropertyValue <String>("Skip")))
                {
                    yield break;
                }
            }

            foreach (var testCommand in _cmd.EnumerateTestCommands(testMethod))
            {
                if (testCommand is MediumTrustTestCommand)
                {
                    yield return(testCommand);

                    continue;
                }

                yield return(new MediumTrustTestCommand(testCommand, null));
            }
        }
Ejemplo n.º 5
0
 public IEnumerable <ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
 {
     return(cmd.EnumerateTestCommands(testMethod));
 }
Ejemplo n.º 6
0
 /// <inheritdoc/>
 public IEnumerable <ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
 {
     return(_testClassCommand.EnumerateTestCommands(testMethod)
            .Select(c => (ITestCommand) new IocLifetimeCommand(c, testMethod)));
 }
Ejemplo n.º 7
0
 public IEnumerable <ITestCommand> EnumerateTestCommands(IMethodInfo testMethod)
 {
     return(originalTestClassCommand.EnumerateTestCommands(testMethod));
 }