public IEnumerator TestClipBeginningNoInterp() { TimelineFloat timeFloat = new TimelineFloat(); yield return(TestInit()); TimedFloat[] testVals = { new TimedFloat(1, 1), new TimedFloat(2, 5), new TimedFloat(3.25f, 25) }; timeFloat.SetValues(testVals); Assert.True(timeFloat.Duration == 2.25f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected points"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(3.0f, false); Assert.True(timeFloat.Duration == 2.25f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected points"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Value == testVals[0].Value, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Timestamp == testVals[0].Timestamp, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(2.25f, false); Assert.True(timeFloat.Duration == 2.25f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected points"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Value == testVals[0].Value, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Timestamp == testVals[0].Timestamp, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(1.67f, false); Assert.True(timeFloat.Duration == 1.67f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Value == 1, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Timestamp == testVals[2].Timestamp - 1.67f, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(0.25f, false); Assert.True(timeFloat.Duration == 0.25f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 2, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Value == 5, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.FirstValue.Timestamp == testVals[2].Timestamp - 0.25f, "TimelineProperty with unexpected Value"); }
public IEnumerator TestClipBeginning() { TimelineFloat timeFloat = new TimelineFloat(); yield return(TestInit()); timeFloat.ClipDurationFromBeginning(1.0f); yield return(TestInit()); TimedFloat[] testVals = { new TimedFloat(1, 5), new TimedFloat(2, 5), new TimedFloat(3.25f, 25) }; timeFloat.SetValues(testVals); Assert.True(timeFloat.Duration == 2.25f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected points"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(3.0f); Assert.True(timeFloat.Duration == 2.25f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected points"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(2.25f); Assert.True(timeFloat.Duration == 2.25f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected points"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(1.5f); Assert.True(timeFloat.Duration == 1.5f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); timeFloat.ClipDurationFromBeginning(0.5f); Assert.True(timeFloat.Duration == 0.5f, "TimelineProperty with unexpected Duration"); Assert.True(timeFloat.TimePoints == 2, "TimelineProperty with unexpected Value"); Assert.True(timeFloat.Value == testVals[2].Value, "TimelineProperty with unexpected Value"); }