PointProfileTests.cs 926 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using Microsoft.Xna.Framework;
  3. using MonoGame.Extended.Particles.Profiles;
  4. namespace MonoGame.Extended.Tests.Particles.Profiles
  5. {
  6. public class PointProfileTests
  7. {
  8. [Fact]
  9. public unsafe void ReturnsZeroOffset()
  10. {
  11. PointProfile subject = new PointProfile();
  12. Vector2 offset;
  13. Vector2 heading;
  14. subject.GetOffsetAndHeading(&offset, &heading);
  15. Assert.Equal(0f, offset.X);
  16. Assert.Equal(0f, offset.Y);
  17. }
  18. [Fact]
  19. public unsafe void ReturnsHeadingAsUnitVector()
  20. {
  21. PointProfile subject = new PointProfile();
  22. Vector2 offset;
  23. Vector2 heading;
  24. subject.GetOffsetAndHeading(&offset, &heading);
  25. double length = Math.Sqrt(heading.X * heading.X + heading.Y * heading.Y);
  26. Assert.Equal(1f, length, 6);
  27. }
  28. }
  29. }