public IEnumerator TestClipEndNoInterp()
    {
        TimelineFloat timeFloat = new TimelineFloat();

        yield return(TestInit());

        timeFloat.ClipDurationFromEnd(1.0f);
        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.ClipDurationFromEnd(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");

        timeFloat.ClipDurationFromEnd(2.15f, false);

        Assert.True(timeFloat.Duration == 2.15f, "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.ClipDurationFromEnd(2, false);

        Assert.True(Mathf.Approximately(timeFloat.Duration, 2), "TimelineProperty with unexpected Duration");
        Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected Value");
        Assert.True(timeFloat.Value == 5, "TimelineProperty with unexpected Value");
        Assert.True(timeFloat.LastInstant == 3, "TimelineProperty with unexpected Value");


        timeFloat.ClipDurationFromEnd(0.5f, false);

        Assert.True(Mathf.Approximately(timeFloat.Duration, 0.5f), "TimelineProperty with unexpected Duration");
        Assert.True(timeFloat.TimePoints == 2, "TimelineProperty with unexpected Value");
        Assert.True(timeFloat.Value == 1, "TimelineProperty with unexpected Value");
        Assert.True(timeFloat.LastInstant == 1 + 0.5f, "TimelineProperty with unexpected Value");
        yield return(null);
    }
    public IEnumerator TestClipEnd()
    {
        TimelineFloat timeFloat = new TimelineFloat();

        yield return(TestInit());

        timeFloat.ClipDurationFromEnd(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.ClipDurationFromEnd(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.ClipDurationFromEnd(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.ClipDurationFromEnd(1.5f);

        float expectedValue = QuickInterpolation(testVals[1], testVals[2], 2.5f);

        Assert.True(timeFloat.Duration == 1.5f, "TimelineProperty with unexpected Duration");
        Assert.True(timeFloat.TimePoints == 3, "TimelineProperty with unexpected Value");
        Assert.True(timeFloat.Value == expectedValue, "TimelineProperty with unexpected Value");


        timeFloat.ClipDurationFromEnd(0.5f);

        expectedValue = QuickInterpolation(testVals[0], testVals[1], 1.5f);
        Assert.True(timeFloat.Duration == 0.5f, "TimelineProperty with unexpected Duration");
        Assert.True(timeFloat.TimePoints == 2, "TimelineProperty with unexpected Value");
        Assert.True(timeFloat.Value == expectedValue, "TimelineProperty with unexpected Value");
    }