@ -351,6 +351,26 @@ namespace NzbDrone.Common.Test.DiskTests
. Verify ( v = > v . DeleteFile ( _targetPath ) , Times . Once ( ) ) ;
}
[Test]
public void should_not_rollback_move_on_partial_if_destination_already_exists ( )
{
Mocker . GetMock < IDiskProvider > ( )
. Setup ( v = > v . MoveFile ( _sourcePath , _targetPath , false ) )
. Callback ( ( ) = >
{
WithExistingFile ( _targetPath , true , 900 ) ;
} ) ;
Mocker . GetMock < IDiskProvider > ( )
. Setup ( v = > v . MoveFile ( _sourcePath , _targetPath , false ) )
. Throws ( new FileAlreadyExistsException ( "File already exists" , _targetPath ) ) ;
Assert . Throws < FileAlreadyExistsException > ( ( ) = > Subject . TransferFile ( _sourcePath , _targetPath , TransferMode . Move ) ) ;
Mocker . GetMock < IDiskProvider > ( )
. Verify ( v = > v . DeleteFile ( _targetPath ) , Times . Never ( ) ) ;
}
[Test]
public void should_log_error_if_rollback_partialmove_fails ( )
{