Skip to content

Commit

Permalink
Add missing test case for Sprite.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Kirby committed Jun 29, 2016
1 parent a731c56 commit feaf748
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/XogoEngine.Test/Graphics/SpriteTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,17 @@ public void SpriteModifiedEvent_ShouldNotBeFired_IfSpriteHasNotChanged()
invoked.ShouldBeFalse();
sprite.SpriteModified -= action;
}

[Test]
public void SpriteModifiedEvent_ShouldBeFired_OnSwitchedTextureRegion()
{
bool invoked = false;
Sprite.SpriteHandler action = (sender, e) => invoked = true;
sprite.SpriteModified += action;

sprite.Modify(s => s.TextureRegion = new TextureRegion(0, 0, 50, 50));
invoked.ShouldBeTrue();
sprite.SpriteModified -= action;
}
}
}

0 comments on commit feaf748

Please sign in to comment.