Esempio 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));
        }
Esempio 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);
        }
Esempio 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));
        }
Esempio 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);
        }