-
-
Save HowardvanRooijen/929950cf41e1cdaa26941d4f2c9da050 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Binding] | |
public class NUnit3Hooks | |
{ | |
[BeforeFeature("workingdirectory_feature")] | |
public static void ChangeWorkingDirectory() | |
{ | |
FeatureContext.Current.Add("NUnit3Hooks.OldWorkingDirectory", Directory.GetCurrentDirectory()); | |
Directory.SetCurrentDirectory(TestContext.CurrentContext.TestDirectory); | |
} | |
[AfterFeature("workingdirectory_feature")] | |
public static void RestoreWorkingDirectory() | |
{ | |
Directory.SetCurrentDirectory(FeatureContext.Current.Get("NUnit3Hooks.OldWorkingDirectory")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment