Export to GitHub

gong-wpf-dragdrop - issue #48

DropInfo is not testable


Posted on Sep 20, 2012 by Massive Elephant

What steps will reproduce the problem? 1. I tried mock DropInfo to test IDropTarget implementation using Moq

var fakeDropInfo = new Mock<DropInfo>(); fakeDropInfo.SetupGet(d => d.Data).Returns(file); fakeDropInfo.SetupGet(d => d.TargetItem).Returns(targetDataTag);

(dialog as IDropTarget).Drop(fakeDropInfo.Object);

  1. I get the error :

Invalid setup on a non-virtual (overridable in VB) member: d => d.Data

What is the expected output? What do you see instead?

I think the 'DropInfo' class should be testable. Currently it is not implementing any interface and not marked by virtual.

Comment #1

Posted on Sep 20, 2012 by Massive Elephant

I am so sorry that I didn't look at the latest source code. I didn't know that the DropInfo has changed to implement IDropInfo interface.

I want to delete this issue but I can't find how to do it. Sorry again.

Status: New

Labels:
Type-Defect Priority-Medium