public void MoveRobberNullTileFails() { var initial = new Mock<ITile>(); initial.Setup(t => t.Rawmaterial).Returns(MaterialType.Unsourced); var robber = new Robber(initial.Object); Assert.Throws<ArgumentNullException>(() => robber.Move(null)); }
public void CantMoveRobberToTheSea() { var initial = new Mock<ITile>(); initial.Setup(t => t.Rawmaterial).Returns(MaterialType.Unsourced); var input = new Mock<ITile>(); input.Setup(t => t.Rawmaterial).Returns(MaterialType.Sea); var robber = new Robber(initial.Object); Assert.Throws<ArgumentException>(() => robber.Move(input.Object)); }
public void MoveTest(MaterialType type) { var initial = new Mock<ITile>(); initial.Setup(t => t.Rawmaterial).Returns(MaterialType.Unsourced); var input = new Mock<ITile>(); input.Setup(t => t.Rawmaterial).Returns(type); var robber = new Robber(initial.Object); robber.Move(input.Object); Assert.Equal(input.Object, robber.CurrentTile); }