public void TestColorNoComposition()
        {
            var transform = new SpriteTransform(color: new Color(100, 120, 140, 160));

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(100, final.Color.R);
            Assert.AreEqual(120, final.Color.G);
            Assert.AreEqual(140, final.Color.B);
            Assert.AreEqual(160, final.Color.A);
        }
        public void TestIdentityColor()
        {
            var transform = new SpriteTransform();

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(255, final.Color.R);
            Assert.AreEqual(255, final.Color.G);
            Assert.AreEqual(255, final.Color.B);
            Assert.AreEqual(255, final.Color.A);
        }
        public void TestColorWithSimpleComposition()
        {
            var transform = new SpriteTransform(color: new Color(128, 192, 64, 32));
            var transform2 = new SpriteTransform(transform, color: new Color(255, 255, 255, 255));

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(128, final.Color.R);
            Assert.AreEqual(192, final.Color.G);
            Assert.AreEqual(64, final.Color.B);
            Assert.AreEqual(32, final.Color.A);
        }
        public void TestScaleWithSimpleComposition()
        {
            var transform1 = new SpriteTransform(scale: 2.4f);
            var transform2 = new SpriteTransform(transform1);

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(2.4f, final.Scale);
        }
        public void TestTranslationWithSimpleComposition()
        {
            var transform1 = new SpriteTransform(translation: new Vector(98, 76));
            var transform2 = new SpriteTransform(transform1);

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(new Vector(98, 76), final.Translation);
        }
        public void TestTranslationNoComposition()
        {
            var transform = new SpriteTransform(translation: new Vector(123, 456));

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(new Vector(123, 456), final.Translation);
        }
        public void TestTranslationIdentityComposition()
        {
            var transform = new SpriteTransform(new SpriteTransform(new SpriteTransform()));

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(Vector.Zero, final.Translation);
        }
        public void TestTranslationAfterScalingAndTranslate()
        {
            var transform1 = new SpriteTransform(translation: new Vector(15, -25), scale: 2.0f);
            var transform2 = new SpriteTransform(transform1, new Vector(100, 100));

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(new Vector(215, 175), final.Translation);
            Assert.AreEqual(2.0f, final.Scale);
        }
        public void TestTranslationAfterRotationAndTranslate()
        {
            var transform1 = new SpriteTransform(translation: new Vector(100, 100), rotation: HalfPI * 2);
            var transform2 = new SpriteTransform(transform1, new Vector(50, 25));

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(new Vector(50, 75), final.Translation);
            Assert.AreEqual(HalfPI * 2, final.Rotation);
        }
        public void TestRotateNoComposition()
        {
            var transform = new SpriteTransform(rotation: 3.6f);

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(3.6f, final.Rotation);
        }
        public void TestIdentityRotate()
        {
            var transform = new SpriteTransform();

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(0.0f, final.Rotation);
        }
        public void TestScaleWithComplexComposition()
        {
            var transform1 = new SpriteTransform(scale: 0.4f);
            var transform2 = new SpriteTransform(transform1, scale: 8.0f);

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(3.2f, final.Scale);
        }
        public void TestScaleNoComposition()
        {
            var transform = new SpriteTransform(scale: 6.6f);

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(6.6f, final.Scale);
        }
        public void TestScaleIdentityComposition()
        {
            var transform = new SpriteTransform(new SpriteTransform(new SpriteTransform()));

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(1.0f, final.Scale);
        }
        public void TestRotationAndTranslationAfterTranslate()
        {
            var transform1 = new SpriteTransform(translation: new Vector(100, 100));
            var transform2 = new SpriteTransform(transform1, new Vector(15, -25), -HalfPI);

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(new Vector(115, 75), final.Translation);
            Assert.AreEqual(-HalfPI, final.Rotation);
        }
        public void TestRotateWithSimpleComposition()
        {
            var transform1 = new SpriteTransform(rotation: 5.4f);
            var transform2 = new SpriteTransform(transform1);

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(5.4f, final.Rotation);
        }
        public void TestRotateWithComplexComposition()
        {
            var transform1 = new SpriteTransform(rotation: 1.4f);
            var transform2 = new SpriteTransform(transform1, rotation: -5.0f);

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(-3.6f, final.Rotation);
        }
        public void TestScalingAfterTranslation()
        {
            var transform1 = new SpriteTransform(translation: new Vector(100, 100));
            var transform2 = new SpriteTransform(transform1, scale: 2.0f);

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(new Vector(100, 100), final.Translation);
            Assert.AreEqual(2.0f, final.Scale);
        }
        public void TestTranslationAfterRotation()
        {
            var transform1 = new SpriteTransform(rotation: HalfPI);
            var transform2 = new SpriteTransform(transform1, new Vector(100, 0));

            var final = transform2.GetSpriteFinal();

            Assert.AreEqual(new Vector(0, 100), final.Translation);
            Assert.AreEqual(HalfPI, final.Rotation);
        }
        public void TestIdentityScale()
        {
            var transform = new SpriteTransform();

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(1.0f, final.Scale);
        }
        public void TestRotateIdentityComposition()
        {
            var transform = new SpriteTransform(new SpriteTransform(new SpriteTransform()));

            var final = transform.GetSpriteFinal();

            Assert.AreEqual(0.0f, final.Rotation);
        }