예제 #1
0
        public void MoreThanEase3()
        {
            var breakDownTime         = new HungryTestHelper.TimeRange(5, 15);
            var nutrientOutputRunTime = new HungryTestHelper.TimeRange(5, 15);

            HungryTestHelper helper = new HungryTestHelper(this.IsSingle, 10, 0, 0, 0, 20, breakDownTime, nutrientOutputRunTime);
            var elapseds            = helper.Start();

            Assert.IsTrue(helper.IsCorrect(elapseds));
        }
예제 #2
0
        public void IdealState()
        {
            var breakDownTime         = new HungryTestHelper.TimeRange(0, 0);
            var nutrientOutputRunTime = new HungryTestHelper.TimeRange(0, 0);

            HungryTestHelper helper = new HungryTestHelper(this.IsSingle, 5, 0, 0, 0, 10, breakDownTime, nutrientOutputRunTime);
            var elapseds            = helper.Start();

            Assert.IsTrue(helper.IsCorrect(elapseds));
        }
예제 #3
0
        public void HighLoad2()
        {
            var breakDownTime         = new HungryTestHelper.TimeRange(0, 0);
            var nutrientOutputRunTime = new HungryTestHelper.TimeRange(25, 30);

            HungryTestHelper helper = new HungryTestHelper(this.IsSingle, 10, 0, 0, 0, 20, breakDownTime, nutrientOutputRunTime);
            var elapseds            = helper.Start();

            Assert.IsTrue(IsCorrect(elapseds, 25, 30));
        }
예제 #4
0
        public void LimitNutrients()
        {
            var breakDownTime         = new HungryTestHelper.TimeRange(0, 0);
            var nutrientOutputRunTime = new HungryTestHelper.TimeRange(0, 0);

            HungryTestHelper helper = new HungryTestHelper(this.IsSingle, 10, 2, 0, 5, 20, breakDownTime, nutrientOutputRunTime);

            helper.Start();

            Assert.IsTrue(helper.MaxNutrientCount <= 5);
        }
예제 #5
0
        public void LimitFoods()
        {
            var breakDownTime         = new HungryTestHelper.TimeRange(0, 0);
            var nutrientOutputRunTime = new HungryTestHelper.TimeRange(0, 0);

            HungryTestHelper helper = new HungryTestHelper(this.IsSingle, 10, 2, 5, 0, 20, breakDownTime, nutrientOutputRunTime);

            helper.Start();

            //由于设置了5的储备上限,那么必然有超过5的时候,food被抛弃,所以food的数量应该大于等于5并且小于10
            Assert.IsTrue(helper.DigestedFoodCount < 10 && helper.DigestedFoodCount >= 5);
        }
예제 #6
0
        public void MoreThanEase2()
        {
            var breakDownTime         = new HungryTestHelper.TimeRange(0, 0);
            var nutrientOutputRunTime = new HungryTestHelper.TimeRange(5, 15);

            if (!this.IsSingle)
            {
                Debug.WriteLine("begin");
            }

            HungryTestHelper helper = new HungryTestHelper(this.IsSingle, 5, 0, 0, 0, 20, breakDownTime, nutrientOutputRunTime);
            var elapseds            = helper.Start();

            if (!this.IsSingle)
            {
                Debug.WriteLine("end");
            }
            Assert.IsTrue(helper.IsCorrect(elapseds));
        }