コード例 #1
0
ファイル: LogicTester.cs プロジェクト: nizar20172016/Games
        public void TestPacmanDidDiedFalseDidLoseLifeFalse()
        {
            Point expected = new Point(4, 4);

            this.pacmanModelMock.Object.Pacman      = new Point(4, 4);
            this.pacmanModelMock.Object.RedGhost    = new Point(5, 4);
            this.pacmanModelMock.Object.PacmanLifes = 2;
            PacmanLogic pacmanLogic = new PacmanLogic(this.pacmanModelMock.Object, this.lvl, false);

            bool died = pacmanLogic.PacmanDied();

            Assert.AreEqual(false, died);
            Assert.AreEqual(expected, this.pacmanModelMock.Object.Pacman);
            Assert.AreEqual(2, this.pacmanModelMock.Object.PacmanLifes);
        }
コード例 #2
0
ファイル: LogicTester.cs プロジェクト: nizar20172016/Games
        public void TestPacmanDidDiedTrue()
        {
            Point expected = new Point(1, 30);

            this.pacmanModelMock.Object.Pacman      = new Point(4, 4);
            this.pacmanModelMock.Object.RedGhost    = new Point(4, 4);
            this.pacmanModelMock.Object.PacmanLifes = 1;
            PacmanLogic pacmanLogic = new PacmanLogic(this.pacmanModelMock.Object, this.lvl, false);

            bool died = pacmanLogic.PacmanDied();

            Assert.AreEqual(true, died);
            Assert.AreEqual(expected, this.pacmanModelMock.Object.Pacman);
            Assert.AreEqual(0, this.pacmanModelMock.Object.PacmanLifes);
        }