nunit / nunit/docs

How to avoid the Unhandled Exception in Nunit 3

Open
#304 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
600
Forks
158
Avg merge
16h 8m
Merged PRs (30d)
21

Description

In Nunit 3, window environment, Net45
I run process in a unit test that access a folder not exist:

  Process.Start("process.exe")

The test hang due to 'Unhandled Exception: System.IO.DirectoryNotFoundException: ' and the popup window appear: close the program /debug the program.
Even i try to catch the exception, but i can't.

I read this but it can't help.
How to avoid the Unhandled Exception.
It's best the test fail with a message, not hanging.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Process.Start call and the referenced NUnit documentation issue 193, then review how NUnit 3 handles a child process that raises DirectoryNotFoundException. Document how to prevent the test from hanging and make the failure report an actionable message; the documentation should address the Net45 Windows environment described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing-qa
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.