Beispiel #1
0
        public void GivenAbsolutePathToFile__WithRootedPath__IsValidPath__IsExpected__UNX(string absoluteDirectoryPath,
                                                                                          string fileExtension, bool expected)
        {
            const string    fileName = "test";
            IOHelperService svc      = new IOHelperService(_fileSystem);

            Assert.AreEqual(expected, svc.IsValidPath(
                                _fileSystem.Path.Combine(absoluteDirectoryPath, fileName + fileExtension),
                                string.Empty, fileExtension));
        }
Beispiel #2
0
        public void GivenRelativePathToFile__WithoutRootedPath__IsValidPath__IsFalse_WIN(string absoluteDirectoryPath,
                                                                                         string fileExtension)
        {
            const string    fileName = "test";
            IOHelperService svc      = new IOHelperService(_fileSystem);

            Assert.IsFalse(svc.IsValidPath(
                               _fileSystem.Path.Combine(absoluteDirectoryPath, fileName + fileExtension),
                               string.Empty, fileExtension));
        }
Beispiel #3
0
        public void GivenRelativePathToFile__IsValidPath__IsExpected_WIN(string relativeDirectoryPath, string basePath,
                                                                         string fileExtension, bool expected)
        {
            const string    fileName = "test";
            IOHelperService svc      = new IOHelperService(_fileSystem);

            Assert.AreEqual(expected, svc.IsValidPath(
                                _fileSystem.Path.Combine(relativeDirectoryPath, fileName + fileExtension),
                                basePath, fileExtension));
        }