public void File_AbsolutePath_WithoutSession_ReturnsHintPath() { Assert.IsNull(ExecutionEvents.ActiveSession); var relativepath = @"excel\ascending.xlsx"; var hintpath = Path.Combine(TestDirectory, @"do not exist\no file.txt"); Assert.AreEqual(hintpath, FileSystem.AbsolutePath(relativepath, hintpath)); }
public void File_AbsolutePath_WithFullPathInput_ReturnsInput() { Assert.IsNull(ExecutionEvents.ActiveSession); string wspath = Path.Combine(TestDirectory, @"core\files\dummy.dyn"); var relativepath = @"excel\ascending.xlsx"; var hintpath = Path.Combine(TestDirectory, "core", relativepath); Assert.AreEqual(wspath, FileSystem.AbsolutePath(wspath, hintpath)); }
public void File_AbsolutePath_RelativePathDontExist() { Assert.IsNull(ExecutionEvents.ActiveSession); string wspath = Path.Combine(TestDirectory, @"core\files\dummy.dyn"); var session = new Mock <IExecutionSession>(); session.Setup(s => s.CurrentWorkspacePath).Returns(wspath); SetActiveSession(session.Object); var relativepath = @"do not exist\no file.txt"; var expectedpath = Path.Combine(TestDirectory, @"core\files", relativepath); Assert.AreEqual(expectedpath, FileSystem.AbsolutePath(relativepath)); SetActiveSession(null); }
public void File_AbsolutePath_WithValidHintPath_ReturnsHintPath() { Assert.IsNull(ExecutionEvents.ActiveSession); string wspath = Path.Combine(TestDirectory, @"core\files\dummy.dyn"); var session = new Mock <IExecutionSession>(); session.Setup(s => s.CurrentWorkspacePath).Returns(wspath); SetActiveSession(session.Object); var relativepath = @"excel\ascending.xlsx"; var hintpath = Path.Combine(TestDirectory, "core", relativepath); Assert.AreEqual(hintpath, FileSystem.AbsolutePath(relativepath, hintpath)); SetActiveSession(null); }