Skip to content

Instantly share code, notes, and snippets.

@bpatra bpatra/gist:9533498
Last active Aug 29, 2015

Embed
What would you like to do?
Examples of testing of the DragOver part
[TestMethod]
public void DragOver_With_A_Block_Source_Then_Effects_Should_Be_Set()
{
var dropInfo = new Mock<IDropInfo>();
dropInfo.SetupGet(m => m.Data).Returns(new[] { _club1, _club2 });
dropInfo.SetupGet(m => m.InsertIndex).Returns(3);
_championshipBetViewModel.DragOver(dropInfo.Object);
dropInfo.VerifySet(x => x.DropTargetAdorner = It.IsAny<Type>(), Times.Once);
dropInfo.VerifySet(x => x.Effects = It.IsAny<DragDropEffects>(), Times.Once);
}
[TestMethod]
public void DragOver_With_A_Non_Block_Source_Then_No_Effects_Should_Be_Set()
{
var dropInfo = new Mock<IDropInfo>();
dropInfo.SetupGet(m => m.Data).Returns(new[] { _club2, _club4 });
dropInfo.SetupGet(m => m.InsertIndex).Returns(0);
_championshipBetViewModel.DragOver(dropInfo.Object);
dropInfo.VerifySet(x => x.DropTargetAdorner = It.IsAny<Type>(), Times.Never);
dropInfo.VerifySet(x => x.Effects = It.IsAny<DragDropEffects>(), Times.Never);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.