Skip to content

Instantly share code, notes, and snippets.

@bpatra
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpatra/9533498 to your computer and use it in GitHub Desktop.
Save bpatra/9533498 to your computer and use it in GitHub Desktop.
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