Skip to content

Instantly share code, notes, and snippets.

@bpatra
Last active December 5, 2020 19:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save bpatra/9518403 to your computer and use it in GitHub Desktop.
second example of unit test: when the source is the block containing the two last rows and the target is the second one then the order should not be changed
//same class as before constructor and fields remain the same
[TestMethod]
public void When_Source_Is_Block_LastTwoRows_And_Target_The_Second_Row_Then_Drop_ShouldNot_Modify_Order()
{
var dropInfo = new Mock<IDropInfo>();
dropInfo.SetupGet(m => m.Data).Returns(new[] { _club3, _club4 });
dropInfo.SetupGet(m => m.InsertIndex).Returns(2);
_championshipBetViewModel.Drop(dropInfo.Object);
var resultClubs = _championshipBetViewModel.FootballClubs.Select(x => x.FullName).ToArray();
CollectionAssert.AreEqual(new[] { "Club1", "Club2", "Club3", "Club4" }, resultClubs);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment