Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StopSuiteException not handled? #145

Closed
essenius opened this issue Aug 20, 2016 · 1 comment
Closed

StopSuiteException not handled? #145

essenius opened this issue Aug 20, 2016 · 1 comment

Comments

@essenius
Copy link

essenius commented Aug 20, 2016

Reading the FitNesse SLIM documentation it is supposed to be possible to throw an exception with StopSuite in the name which then should stop execution of the currently running test suite, similarly to the StopTest exception which only stops the current test.

It works fine with a StopTestException, but FitSharp doesn't seem to be handling the StopSuiteException.

I've created a small fixture to show:

        private static void ThrowStopIf(string conditionString, bool stopSuite, bool expectedValue)
        {
            bool condition;

            var raiseException = !bool.TryParse(conditionString, out condition) || condition == expectedValue;
            if (raiseException)
            {
                if (stopSuite)
                {
                    throw new StopSuiteException();
                }
                throw new StopTestException();
            }
        }

        public void StopTestIf(string condition)
        {
            ThrowStopIf(condition, false, true);
        }

        public void StopSuiteIf(string condition)
        {
            ThrowStopIf(condition, true, true);
        }

When I run StopTestIf (using FitNesse 20160618 and FitSharp 2.4) all works fine: the exception is recognized as special and it stops the test.
image

But when I run StopSuiteIf, the StopSuiteException doesn't seem to get handled in a special way:

image

Is FitSharp indeed not handling the StopSuiteException? If so can that be fixed? If not, what am I doing wrong?

@jediwhale
Copy link
Owner

This has not been implemented in fitSharp yet. It will be in the next
release.

On 2016-08-20 13:54, essenius wrote:

Reading the FitNesse SLIM documentation it is supposed to be possible
to throw an exception with |StopSuite| in the name which then should
stop execution of the currently running test suite, similarly to the
|StopTest| exception which only stops the current test.

It works fine with a |StopTestException|, but FitSharp doesn't seem to
be handling the |StopSuiteException|.

I've created a small fixture to show:

| private static void ThrowStopIf(string conditionString, bool stopSuite, bool expectedValue)
{
bool condition;

         var raiseException = !bool.TryParse(conditionString, out condition) || condition == expectedValue;
         if (raiseException)
         {
             if (stopSuite)
             {
                 throw new StopSuiteException();
             }
             throw new StopTestException();
         }
     }

     public void StopTestIf(string condition)
     {
         ThrowStopIf(condition, false, true);
     }

     public void StopSuiteIf(string condition)
     {
         ThrowStopIf(condition, true, true);
     }

|
|
|

works fine: the exception is recognized as special and it stops the test.
image
https://cloud.githubusercontent.com/assets/17417493/17833505/632bd4b0-671f-11e6-9f1e-79ad2a4fbb85.png

But when I run 'StopSuiteIf|, the|StopSuiteException` doesn't seem to
get handled in a special way:

image
https://cloud.githubusercontent.com/assets/17417493/17833506/83efaff0-671f-11e6-895a-d4efff90542a.png

Is FitSharp indeed not handling the StopSuiteException? If so can that
be fixed? If not, what am I doing wrong?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#145, or mute the thread
https://github.com/notifications/unsubscribe-auth/AACXY5V-CLhDdVYvkLwrUjg7ZIMQziDeks5qh1uRgaJpZM4JpJpD.

Cheers,
Mike Stockdale

/fit/Sharp http://fitsharp.github.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants