GetFullPath() public méthode

Get the full path to a file given a path relative to the FileSystemHelper's rootPath.
public GetFullPath ( string relativePath ) : string
relativePath string Relative path.
Résultat string
Exemple #1
0
        /// <summary>
        /// Validate a collection of assertions against files that are expected
        /// to exist in the file system watched by a FileSystemHelper.
        /// </summary>
        /// <param name="files">
        /// The FileSystemHelper watching the files.
        /// </param>
        /// <param name="assertions">
        /// Mapping of relative path names to actions that will validate the
        /// contents of the path.  Each action takes a full path to the file
        /// so it can be opened, verified, etc.  Null actions are allowed and
        /// serve to verify only that a file exists.
        /// </param>
        public static void AssertFiles(this FileSystemHelper files, Dictionary <string, Action <string> > assertions)
        {
            Assert.IsNotNull(files);
            Assert.IsNotNull(assertions);

            foreach (KeyValuePair <string, Action <string> > pair in assertions)
            {
                string path   = files.GetFullPath(pair.Key);
                bool   exists = File.Exists(path);
                Assert.IsTrue(exists, "Expected the existence of file {0}", pair.Key);
                if (exists && pair.Value != null)
                {
                    pair.Value(path);
                }
            }
        }