예제 #1
0
        public void ShouldBeDecrementable()
        {
            var effort    = new Effort(75);
            var newEffort = effort.PreviousLevel();

            Assert.IsTrue(effort.IsHarderThan(newEffort));
        }
예제 #2
0
        public void ShouldBeAvailableAsPercentage()
        {
            const int PERCENTAGE = 75;
            var       effort     = new Effort(PERCENTAGE);

            Assert.AreEqual(PERCENTAGE, effort.AsPercentage());
        }
예제 #3
0
        public void ShouldBeIncrementable()
        {
            var effort    = new Effort(75);
            var newEffort = effort.NextLevel();

            Assert.IsTrue(newEffort.IsHarderThan(effort));
        }
예제 #4
0
파일: Level.cs 프로젝트: fchauvel/heat
 public Scheduler(Circuit circuit, Duration duration, Effort effort)
 {
     candidateLevels = new List <Level>();
     BuildCandidates();
     schedule      = candidateLevels[0];
     this.circuit  = circuit;
     this.duration = duration;
     this.effort   = effort;
 }
예제 #5
0
        public void ShouldBeComparable()
        {
            var effort1 = new Effort(50);
            var effort2 = new Effort(51);
            var effort3 = new Effort(50);

            Assert.AreEqual(effort1, effort1);
            Assert.AreEqual(effort1, effort3);
            Assert.AreNotEqual(effort1, effort2);
        }
예제 #6
0
        public override bool Equals(Object otherObject)
        {
            if (!GetType().IsAssignableFrom(otherObject.GetType()))
            {
                return(false);
            }
            Effort other = (Effort)otherObject;

            return(effort == other.effort);
        }
예제 #7
0
        public void ShouldBeAvailableFromADecimalValue()
        {
            var effort = Effort.FromRatio(0.75);

            Assert.AreEqual(75, effort.AsPercentage());
        }
예제 #8
0
        public void NormalizedValueShouldBeAvailable()
        {
            var effort = new Effort(75);

            Assert.AreEqual(0.75D, effort.Normalized());
        }
예제 #9
0
 public void ShouldRejectValueAbove100()
 {
     var effort = new Effort(140);
 }
예제 #10
0
 public void ShouldRejectNegativeValue()
 {
     var effort = new Effort(-34);
 }
예제 #11
0
        public void ShouldBeSetByDefault()
        {
            var effort = new Effort();

            Assert.IsTrue(effort.IsDefault());
        }
예제 #12
0
파일: Level.cs 프로젝트: fchauvel/heat
 public void Harder()
 {
     effort = effort.NextLevel();
 }
예제 #13
0
파일: Level.cs 프로젝트: fchauvel/heat
 public void Easier()
 {
     effort = effort.PreviousLevel();
 }
예제 #14
0
 public bool IsHarderThan(Effort other)
 {
     return(effort > other.effort);
 }