Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }