NuSelfUpdate.Tests.Helpers.MockFileSystem.MoveFile C# (CSharp) Method

MoveFile() public method

public MoveFile ( string sourcePath, string destinationPath ) : void
sourcePath string
destinationPath string
return void
        public virtual void MoveFile(string sourcePath, string destinationPath)
        {
            Func<Stream> factory;

            if (!Paths.TryGetValue(sourcePath, out factory))
                throw new FileNotFoundException(sourcePath + " not found.");

            if (Paths.ContainsKey(destinationPath))
                throw new IOException(destinationPath + " Already exists");

            Paths.Remove(sourcePath);
            Paths[destinationPath] = factory;
        }