Exemplo n.º 1
0
        public void CanAct_DefaultActions_ReturnTrue()
        {
            var subject = new BUnit(1);

            var noop = new NoopAction();

            Assert.True(subject.CanAttemptAction(noop));
        }
Exemplo n.º 2
0
        public void CanAct_Move_ReturnTrue()
        {
            var subject = new BUnit();

            var move = new MoveAction(MoveAction.Direction.EAST);

            Assert.True(subject.CanAttemptAction(move));
        }
Exemplo n.º 3
0
        public void CanAct_Attack_ReturnTrue()
        {
            var subject = new BUnit();

            var attack = new AttackAction(Guid.NewGuid());

            Assert.True(subject.CanAttemptAction(attack));
        }
Exemplo n.º 4
0
        public void CanTake_SpaceForFood_ReturnTrue()
        {
            //Setup
            var subject = new BUnit(1);
            var action  = new TakeAction(Guid.NewGuid());

            //Act
            var canAct = subject.CanAttemptAction(action);

            //Assert
            Assert.True(canAct);
        }
Exemplo n.º 5
0
        public void CanGive_FoodNotOwned_ReturnFalse()
        {
            //Setup
            var subject = new BUnit();
            var action  = new GiveAction(Guid.NewGuid(), Guid.NewGuid());

            //Act
            var canAct = subject.CanAttemptAction(action);

            //Assert
            Assert.False(canAct);
        }
Exemplo n.º 6
0
        public void CanGive_FoodOwned_ReturnTrue()
        {
            //Setup
            var subject  = new BUnit(50);
            var quantity = new Random().Next(1, 50);
            var food     = new Food(quantity, Food.FoodQuality.FAIR);
            var action   = new GiveAction(food.Id, Guid.NewGuid());

            subject.Take(food);

            //Act
            var canAct = subject.CanAttemptAction(action);

            //Assert
            Assert.True(canAct);
        }