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)); }
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)); }
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)); }
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); }
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); }
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)); }