Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        public void TestRobberConstruction()
        {
            var tile = new Mock<ITile>();
            tile.Setup(t => t.Rawmaterial).Returns(MaterialType.Unsourced);

            var robber = new Robber(tile.Object);
            Assert.Equal(tile.Object, robber.CurrentTile);
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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);
        }