public void TestNotHasOwner()
        {
            //Arrange
            RealState r = new RealState(50, 5);

            //Act

            //Assert
            Assert.IsFalse(r.HasOwner());
        }
        public void TestForeclose()
        {
            //Arrange
            Player    p = new Player(0);
            RealState r = new RealState(50, 5, owner: p);

            //Act
            r.Foreclose();

            //Assert
            Assert.IsFalse(r.HasOwner());
        }
        public void TestHasOwner()
        {
            //Arrange
            Player    p = new Player(0);
            RealState r = new RealState(50, 5, owner: p);

            //Act

            //Assert
            Assert.IsTrue(r.HasOwner());
            Assert.AreEqual(p, r.Owner);
        }
        public void TestSell()
        {
            //Arrange
            Player    p = new Player(100);
            RealState r = new RealState(50, 5);

            //Act
            r.SellTo(p);

            //Assert
            Assert.IsTrue(r.HasOwner());
            Assert.IsTrue(r.OwnerIs(p));
            Assert.AreEqual(50, p.Balance);
        }
Esempio n. 5
0
        public void TestTurnNotEnoughMoney()
        {
            //Arrange
            Player    p = new Player(0);
            RealState r = new RealState(100, 50);
            Board     b = new Board(new List <Player>()
            {
                p
            }, new List <RealState>()
            {
                r
            });

            //Act
            b.Turn(p, 1);

            //Assert
            Assert.IsFalse(r.HasOwner());
            Assert.AreEqual(0, p.Balance);
        }
Esempio n. 6
0
        public void TestTurnAbortInvestment()
        {
            //Arrange
            Player    p = new Player(300, new Demanding());
            RealState r = new RealState(100, 50);
            Board     b = new Board(new List <Player>()
            {
                p
            }, new List <RealState>()
            {
                r
            });

            //Act
            b.Turn(p, 1);

            //Assert
            Assert.IsFalse(r.HasOwner());
            Assert.AreEqual(300, p.Balance);
        }