Exemplo n.º 1
0
        public void Drop_NonFood_ReturnFalse()
        {
            //Setup
            var subject = new BUnit(0);
            var item    = new Mock <ITransferable>();

            //Act
            var canDrop = subject.Drop(item.Object);

            //Assert
            Assert.False(canDrop);
        }
Exemplo n.º 2
0
        public void Drop_FoodOwned_LessFood()
        {
            //Setup
            var subject  = new BUnit(50);
            var quantity = new Random().Next(1, 50);
            var food     = new Food(quantity, Food.FoodQuality.FAIR);

            subject.Take(food);

            //Act
            var canDrop = subject.Drop(food);

            //Assert
            Assert.True(canDrop);
            Assert.Equal(0, subject.TotalFoodQuantity);
        }
Exemplo n.º 3
0
        public void Drop_DoNotOwnFood_CannotDrop()
        {
            //Setup
            var subject  = new BUnit(50);
            var quantity = new Random().Next(1, 50);
            var food     = new Food(quantity, Food.FoodQuality.FAIR);
            var altFood  = new Food(quantity + 1, Food.FoodQuality.POOR);

            subject.Take(food);

            //Act
            var canDrop = subject.Drop(altFood);

            //Assert
            Assert.False(canDrop);
            Assert.Equal(quantity, subject.TotalFoodQuantity);
        }