public void ShouldBeDecrementable() { var effort = new Effort(75); var newEffort = effort.PreviousLevel(); Assert.IsTrue(effort.IsHarderThan(newEffort)); }
public void ShouldBeAvailableAsPercentage() { const int PERCENTAGE = 75; var effort = new Effort(PERCENTAGE); Assert.AreEqual(PERCENTAGE, effort.AsPercentage()); }
public void ShouldBeIncrementable() { var effort = new Effort(75); var newEffort = effort.NextLevel(); Assert.IsTrue(newEffort.IsHarderThan(effort)); }
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; }
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); }
public override bool Equals(Object otherObject) { if (!GetType().IsAssignableFrom(otherObject.GetType())) { return(false); } Effort other = (Effort)otherObject; return(effort == other.effort); }
public void ShouldBeAvailableFromADecimalValue() { var effort = Effort.FromRatio(0.75); Assert.AreEqual(75, effort.AsPercentage()); }
public void NormalizedValueShouldBeAvailable() { var effort = new Effort(75); Assert.AreEqual(0.75D, effort.Normalized()); }
public void ShouldRejectValueAbove100() { var effort = new Effort(140); }
public void ShouldRejectNegativeValue() { var effort = new Effort(-34); }
public void ShouldBeSetByDefault() { var effort = new Effort(); Assert.IsTrue(effort.IsDefault()); }
public void Harder() { effort = effort.NextLevel(); }
public void Easier() { effort = effort.PreviousLevel(); }
public bool IsHarderThan(Effort other) { return(effort > other.effort); }