NUnit Test function that uses an executable path to open a file

I have a function that opens a help file for an application. The function takes 3 arguments:

ShowHelp (appPath, 1, @ "Heelp \ help.doc")

  • The first argument is the starting path.
  • The second argument is that the absence aligns the initial path.
  • The third argument is the path to the help file after going to n levels from the start path.

To verify this, I created the Resources folder in my test project, added a document to this folder and provided below:

controller.ShowHelp (Application.ExecutablePath, 1, @ "Resources \ h.doc");

However, when I run this through test driven.net, my executable path returns as:

"C: \ Program Files \ TestDriven.NET 2.0 \ ProcessInvocation.exe"

  • ?
  • ?

!

+3
2

Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)

, , , - (..\bin\Debug), .

+2

Source: https://habr.com/ru/post/1723331/


All Articles