0

I have opened a bug with Jetbrains but I am hoping that posting in SO will get more visibility.

Instead of running the test from the bin\debug directory, the directory is being changed to: C:\Users\{username}\AppData\Local\JetBrains\Installations\ReSharperPlatformVs12

JetBrains ReSharper Ultimate 10.0.2 Build 104.0.20151218.120627 ReSharper 10.0.20151218.130009

The current workaround I have is:

  1. uninstalling ReSharper version 10
  2. uninstall NUnit 3
  3. Install ReSharper version 9.2
  4. installing NUnit Version 2.6.4.

Here is the bug: https://youtrack.jetbrains.com/issue/RSRP-453391

Community
  • 1
  • 1
Pouya Barrach-Yousefi
  • 1,207
  • 1
  • 13
  • 27

1 Answers1

2

Do you use CurrentDirectory in tests? If so, please refer to NUnit 3.0 Breaking-Changes page:

CurrentDirectory No longer set to the directory containing the test assembly. Use TestContext.TestDirectory to locate that directory.

Alexander Kurakin
  • 13,373
  • 2
  • 33
  • 29
  • Within the class that I am testing, I have the code: var curDir = Environment.CurrentDirectory; I am guessing this is bad. I think I should use a static path. – Pouya Barrach-Yousefi Jan 29 '16 at 14:58
  • Per Charlie Pool: "This is by design, as shown here: https://github.com/nunit/nunit/wiki/Breaking-Changes In earlier versions, NUnit changed the working directory. It no longer does so. You can use TestContext.TestDirectory to get the directory that contains the test assembly." https://github.com/nunit/nunit/issues/1072 – Pouya Barrach-Yousefi Jan 29 '16 at 21:35
  • 1
    `TestContext.CurrentContext.TestDirectory` to be precise – DavWEB May 24 '16 at 14:01