summaryrefslogtreecommitdiff
path: root/Plugins/MonoGame.Extended/tests/MonoGame.Extended.Tests/Particles/Profiles/PointProfileTests.cs
blob: cb22b3bdad43aa0c3fbf788d20881f98d2e1c043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
using MonoGame.Extended.Particles.Profiles;
using Xunit;

namespace MonoGame.Extended.Tests.Particles.Profiles
{

    public class PointProfileTests
    {
        [Fact]
        public void ReturnsZeroOffset()
        {
            var subject = new PointProfile();

            subject.GetOffsetAndHeading(out var offset, out _);

            Assert.Equal(0f, offset.X);
            Assert.Equal(0f, offset.Y);
        }

        [Fact]
        public void ReturnsHeadingAsUnitVector()
        {
            var subject = new PointProfile();

            subject.GetOffsetAndHeading(out _, out var heading);

            var length = Math.Sqrt(heading.X * heading.X + heading.Y * heading.Y);
            Assert.Equal(1f, length, 6);
        }

    }
}