public void GitFs_WhenStashesCurrentState_RemovesUntrackedFiles() { var testPath = Path.Combine(Utils.GetProjectRootDirectory(), Constants.VanillaTestData, "aaa"); try { File.WriteAllText(testPath, "aaa"); gitFileService.StashCurrentStateIfDirty(Constants.VanillaEnvironment, false); Assert.False(File.Exists(testPath)); } finally { File.Delete(testPath); } }
/// <summary> /// Typically called if a test fails /// stashes the current state of the test environment under a commit hash and logs this. /// The user can do commit apply hash to restore the state and /// then commit reset --hard -- <testenvironment-root-directory> /// </summary> /// <param name="suppressLog"></param> public void Terminate(bool suppressLog) { fileService.StashCurrentStateIfDirty(environment, suppressLog); }