Skip to content

Commit

Permalink
Added a tween test to verify that tweens dispose works as expected
Browse files Browse the repository at this point in the history
  • Loading branch information
NTaylorMullen committed Aug 1, 2013
1 parent 53f5706 commit 490d530
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions EndGate/tests/EndGate.Core.JS.Tests/Tests/Tweening/TweenFacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@

QUnit.module("Tween Facts");

QUnit.test("Tween's dispose unbinds bound events and stops the tween.", function () {
var tween = new eg.Tweening.NumberTween(0, 3, eg.TimeSpan.FromSeconds(.3), eg.Tweening.Functions.Linear.EaseNone);

tween.OnChange.Bind(function () {});
tween.OnComplete.Bind(function () {});

QUnit.isTrue(tween.OnChange.HasBindings());
QUnit.isTrue(tween.OnComplete.HasBindings());

tween.Play();

QUnit.isTrue(tween.IsPlaying());

tween.Dispose();

QUnit.isFalse(tween.OnChange.HasBindings());
QUnit.isFalse(tween.OnComplete.HasBindings());
QUnit.isFalse(tween.IsPlaying());
});

QUnit.test("Tween's have onChange triggered on the last tween interval.", function () {
var from = 0,
to = 3,
Expand Down

0 comments on commit 490d530

Please sign in to comment.