Hope I don't miss anything with Calibrun, but why mock DragEventArgs when you can create it? An important part is the IDataObject part, which is an interface and can be easily crafted.
[Test] public void ExtractFilePaths_WithFileDrop_ReturndDropPaths() { var fileList = new[] {@"c:\path\path\file1.txt", @"d:\path2\path2\file2.txt"}; var stubData = Mock.Of<IDataObject>(x => x.GetDataPresent(DataFormats.FileDrop) == true && x.GetData(DataFormats.FileDrop, true) == fileList); var dragEventArgs = new DragEventArgs(stubData, 0, 0, 0, DragDropEffects.Move, DragDropEffects.Scroll); var subject = new Subject();
source share