Exemplo n.º 1
0
        public void TestGetLocationAt()
        {
            Factory   chessModelFactory = (Factory)Ctx.GetObject("ChessModelFactory");
            Board     board             = (Board)Ctx.GetObject("Board");
            BoardImpl boardImpl         = (BoardImpl)board;
            File      file     = File.FileA;
            Rank      rank     = Rank.Rank8;
            Location  location = boardImpl.GetLocationAt(file, rank);

            Assert.IsNotNull(location);
            Assert.That(location.Shade, Is.EqualTo(Shade.Light));
        }
Exemplo n.º 2
0
        public void TestSetLocationAt()
        {
            Factory   chessModelFactory = (Factory)Ctx.GetObject("ChessModelFactory");
            Board     board             = (Board)Ctx.GetObject("Board");
            BoardImpl boardImpl         = (BoardImpl)board;
            Location  location          = chessModelFactory.NewLocation(Shade.Light);
            File      file = File.FileA;
            Rank      rank = Rank.Rank8;

            boardImpl.SetLocationAt(location, file, rank);
            Assert.AreEqual(location, boardImpl.GetLocationAt(file, rank));
        }