Skip to content

Directory.Move() throws exceptions when trying to move a file, not a directory. #187

@AlexanderPruss

Description

@AlexanderPruss

Directory.Move() should be able to move files: https://msdn.microsoft.com/en-us/library/system.io.directory.move(v=vs.110).aspx

The current implementation of MockDirectory, however, assumes that the moved object is a directory and throws an exception.

System.IO.Abstractions.TestingHelpers.dll!System.IO.Abstractions.TestingHelpers.MockDirectory.EnumerateDirectories(string path, string searchPattern, System.IO.SearchOption searchOption)
System.IO.Abstractions.TestingHelpers.dll!System.IO.Abstractions.TestingHelpers.MockDirectory.GetDirectories(string path, string searchPattern, System.IO.SearchOption searchOption)
System.IO.Abstractions.TestingHelpers.dll!System.IO.Abstractions.TestingHelpers.MockDirectory.GetDirectories(string path, string searchPattern)
System.IO.Abstractions.TestingHelpers.dll!System.IO.Abstractions.TestingHelpers.MockDirectory.GetDirectories(string path)
System.IO.Abstractions.TestingHelpers.dll!System.IO.Abstractions.TestingHelpers.MockDirectory.Move(string sourceDirName, string destDirName)

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: in workIssues that are currently worked ontype: bugIssues that describe misbehaving functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions