Issue 293

Change all file and directory tests to use the temporary directory
(Path.GetTempPath) for all directories and files created or tested.
Also, make CF fixes to the tests where necessary.
I just went back and examined the issue further.  In fact, for these specific tests, it makes no difference.  The one without the Z: should be able to be used.  None of these tests examine the exceptions that occur from file/directory operations on invalid directory paths.

 

The point was that a different exception message is given for an invalid drive letter and for an invalid path on a drive (in normal .NET), so it was possible that by using the path without the Z: the test results could be changed.

 

However, in this case, they should not be.  I have changed the file.

 

From: CharliePoole [mailto:notifications@github.com] 
Sent: Sunday, November 23, 2014 11:41 AM
To: nunit/nunit
Cc: oznetmaster
Subject: Re: [nunit] Issue 293 (#381)

 

In src/NUnitFramework/tests/Assertions/DirectoryAssertTests.cs:

> @@ -37,7 +37,11 @@ public class DirectoryAssertTests
>      {
>          private TestDirectory _goodDir1;
>          private TestDirectory _goodDir2;
> +#if NETCF
> +        private const string BAD_DIRECTORY = @"\I\hope\this\is\garbage";

Apparently I missed the answer. Generally, in these reviews, we try to help one another understand.

AFAICS, \I\hope\this\is\garbage would work as a non-existent directory path for every build. However, I haven't actually tried it. You said it would fail for some other reason. I don't understand what you mean.

—
Reply to this email directly or view it on GitHub <https://github.com/nunit/nunit/pull/381/files#r20761823> .  <https://github.com/notifications/beacon/AFh64UIPeYLRkatvIi3EBoI9vN1fvLhLks5nQU7XgaJpZM4C_f68.gif>