Examples of testing of the DragOver part
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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