Ejemplo n.º 1
0
        public void Token()
        {
            var ship = new Ship(new TokenPool());
            Assert.IsNull(ship.Token);

            ship.Add(ItemToken.newCotton());
            Assert.AreEqual(ItemToken.newCotton(), ship.Token);
        }
Ejemplo n.º 2
0
        public void Return()
        {
            var ship = new Ship(new TokenPool());
            ship.Add(ItemToken.newHemp());

            ship.Return();

            Assert.AreEqual(null, ship.Token);
        }
Ejemplo n.º 3
0
        public void MoveTo()
        {
            _pool.Setup();
            var ship = new Ship(_pool);

            _pool.MoveTo(ship, ItemToken.newCopper());

            Assert.AreEqual(4, _pool.CopperCount, "プールのコマ");
            Assert.AreEqual(ItemToken.newCopper(), ship.Token, "船のコマ");
        }
Ejemplo n.º 4
0
        public void MoveTo(Ship ship, ItemToken token)
        {
            int temp = count(token);

            Debug.Assert(temp != 0, "コマが0個です");

            _tokens.Remove(token);

            ship.Add(token);
        }
Ejemplo n.º 5
0
        public void MoveTo_TwoShips()
        {
            _pool.Setup();
            var ship1 = new Ship(_pool);
            var ship2 = new Ship(_pool);


            _pool.MoveTo(ship1, ItemToken.newCopper());
            _pool.MoveTo(ship2, ItemToken.newCopper());

            Assert.AreEqual(3, _pool.CopperCount, "プールのコマ");
            Assert.AreEqual(ItemToken.newCopper(), ship1.Token, "船1のコマ");
            Assert.AreEqual(ItemToken.newCopper(), ship2.Token, "船2のコマ");
        }
Ejemplo n.º 6
0
 public void Add()
 {
     var ship = new Ship(new TokenPool());
     ship.Add(ItemToken.newCopper());
 }