NUnitTestMethod not calling RUN

2 posts, 0 answers
  1. Ken
    Ken avatar
    2 posts
    Member since:
    Jun 2013

    Posted 27 Apr 2015 Link to this post

    I'm writing a decorator (to implement a Retry attributes for NUnit tests). Everything runs fine when executing with Telerik JustTest -- except:

    * "Not Executed" is reported

    * Stepping thru in debug, "Run" is never called

    Using NUnit 2.6. I have read that Resharper has issues in this same area and there are workarounds. We run Nunit for deployment builds, and I would like to be able to run the tests in VS.

        public class RetriedTestMethod : NUnit.Core.Test
            private readonly int requiredPassCount;
            private readonly int tryCount;
            private readonly NUnit.Core.Test backingTest;

            public RetriedTestMethod(NUnitTestMethod test, int tryCount, int requiredPassCount)
                : base((TestName)test.TestName.Clone())
            { //executes in debug
                backingTest = test;
                this.tryCount = tryCount;
                this.requiredPassCount = requiredPassCount;
              private static bool TestFailed(TestResult result)
                return result.ResultState == ResultState.Error || result.ResultState == ResultState.Failure;
            public override TestResult Run(EventListener listener, ITestFilter filter)
            { //Never called
                var successCount = 0;
                TestResult failureResult = null;
                for (var i = 0; i < this.tryCount; i++)
                    var result = backingTest.Run(listener, filter);
                    if (!TestFailed(result))
                        if (i == 0)
                            return result;
                        if (++successCount >= this.requiredPassCount)
                            return result;
                        failureResult = result;
                return failureResult;

    I attached the set of files with unit tests.

  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 30 Apr 2015 Link to this post

    Hi Ken,

    Thank you for contacting us.

    This forum is related to Telerik Testing Framwork. 

    Do you use it for building your tests? I cannot fully understand from your post.

    If not I will change this thread to JustCode.

    Looking forward to hearing from you.

    Boyan Boev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top