public void FactsAboutTheFullDuration() { var td = new TuneDuration(180); Assert.AreEqual(180d, td.Duration()); Assert.AreEqual(180d, td.Remaining(0d)); Assert.AreEqual(90d, td.Remaining(90d)); Assert.IsTrue(td.Includes(0)); Assert.IsTrue(td.Includes(new ZeroToOne(0))); Assert.IsTrue(td.Includes(1)); Assert.IsTrue(td.Includes(new ZeroToOne(1))); Assert.AreEqual(0d, td.StartingPoint()); Assert.AreEqual(0d, td.Progress(0d).Value()); Assert.AreEqual(1d, td.Progress(180d).Value()); Assert.AreEqual(0.5d, td.Progress(90d).Value()); Assert.AreEqual(45d, td.ActualPosition(0.25d)); Assert.AreEqual(0d, td.HiddenBefore(2450)); }
public void FactsAboutZoomedInDurationThatIncludesEnd() { var td = new TuneDuration(120, 180, 2.0); Assert.AreEqual(90d, td.Duration()); Assert.AreEqual(90d, td.Remaining(90d)); Assert.AreEqual(80, td.Remaining(100d)); Assert.IsFalse(td.Includes(0)); Assert.IsFalse(td.Includes(new ZeroToOne(0))); Assert.IsTrue(td.Includes(1)); Assert.IsTrue(td.Includes(new ZeroToOne(1))); Assert.IsTrue(td.Includes(0.5)); Assert.IsTrue(td.Includes(new ZeroToOne(0.5))); Assert.AreEqual(90d, td.StartingPoint()); Assert.AreEqual(0d, td.Progress(0d).Value()); Assert.AreEqual(0d, td.Progress(90d).Value()); Assert.AreEqual(1d, td.Progress(180d).Value()); Assert.AreEqual(135d, td.ActualPosition(0.5d)); Assert.AreEqual(1225d, td.HiddenBefore(2450)); }