public void ShouldReturnUsedTime_moreThanDuration() { var tween = new TestTween(new TimeSpan(100)); var result = tween.Advance(new TimeSpan(150)); Assert.Equal(100, result.Ticks); }
public void DurationShouldBeSetCorrectly(int duration) { var tween = new TestTween(TimeSpan.FromTicks(duration)); Assert.Equal(duration, tween.Duration.Ticks); Assert.Equal(duration, tween.RemainingDuration.Ticks); }
public void RemainingDurationShouldBeCalculatedCorrectly() { var tween = new TestTween(TimeSpan.FromTicks(100)); tween.Advance(TimeSpan.FromTicks(50)); Assert.Equal(50, tween.RemainingDuration.Ticks); }
public void ProtectedHandleUpdateIsCalledOnUpdate() { var tween = new TestTween(new TimeSpan(100)); tween.Advance(new TimeSpan(1)); Assert.True(tween.WasAdvanceCalled); }
public void FinishedCallbackIsTriggeredWhenTweenFinishes() { var wasFinishCalled = false; var tween = new TestTween(new TimeSpan(100), () => wasFinishCalled = true); tween.Advance(new TimeSpan(100)); Assert.True(wasFinishCalled); }
public void ShouldReturnZeroTimeWhenTweenIsAlreadyFinished() { var tween = new TestTween(new TimeSpan(100)); tween.Finish(); var result = tween.Advance(new TimeSpan(100)); Assert.Equal(0, result.Ticks); }
public void FinishShouldInvokeUpdateAndFinishCallback() { var wasFinishCalled = false; var tween = new TestTween(new TimeSpan(100), () => wasFinishCalled = true); tween.Finish(); Assert.True(wasFinishCalled); Assert.True(tween.WasAdvanceCalled); }