示例#1
0
        public void TextUtilsShadowParametersConstructor()
        {
            tlog.Debug(tag, $"TextUtilsShadowParametersConstructor START");

            var testingTarget = new ShadowParameters();

            Assert.IsNotNull(testingTarget, "Can't create success object ShadowParameters");
            Assert.IsInstanceOf <ShadowParameters>(testingTarget, "Should be an instance of ShadowParameters type.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextUtilsShadowParametersConstructor END (OK)");
        }
示例#2
0
        public void TextUtilsShadowParametersOffset()
        {
            tlog.Debug(tag, $"TextUtilsShadowParametersOffset START");

            var testingTarget = new ShadowParameters();

            Assert.IsNotNull(testingTarget, "Can't create success object ShadowParameters");
            Assert.IsInstanceOf <ShadowParameters>(testingTarget, "Should be an instance of ShadowParameters type.");

            testingTarget.Offset = new Vector2(0.3f, 0.8f);
            Assert.AreEqual(0.3f, testingTarget.Offset.X, "Should be equal!");
            Assert.AreEqual(0.8f, testingTarget.Offset.Y, "Should be equal!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextUtilsShadowParametersOffset END (OK)");
        }
示例#3
0
        public void TextUtilsShadowParametersInput()
        {
            tlog.Debug(tag, $"TextUtilsShadowParametersInput START");

            var testingTarget = new ShadowParameters();

            Assert.IsNotNull(testingTarget, "Can't create success object ShadowParameters");
            Assert.IsInstanceOf <ShadowParameters>(testingTarget, "Should be an instance of ShadowParameters type.");

            testingTarget.Input = new PixelBuffer(30, 50, PixelFormat.A8);
            Assert.AreEqual(30, testingTarget.Input.GetWidth(), "Should be equal!");
            Assert.AreEqual(50, testingTarget.Input.GetHeight(), "Should be equal!");
            Assert.AreEqual(PixelFormat.A8, testingTarget.Input.GetPixelFormat(), "Should be equal!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextUtilsShadowParametersInput END (OK)");
        }
示例#4
0
        public void TextUtilsShadowParametersTextColor()
        {
            tlog.Debug(tag, $"TextUtilsShadowParametersTextColor START");

            var testingTarget = new ShadowParameters();

            Assert.IsNotNull(testingTarget, "Can't create success object ShadowParameters");
            Assert.IsInstanceOf <ShadowParameters>(testingTarget, "Should be an instance of ShadowParameters type.");

            testingTarget.TextColor = new Vector4(0.3f, 0.8f, 1.0f, 0.0f);
            Assert.AreEqual(0.3f, testingTarget.TextColor.R, "Should be equal!");
            Assert.AreEqual(0.8f, testingTarget.TextColor.G, "Should be equal!");
            Assert.AreEqual(1.0f, testingTarget.TextColor.B, "Should be equal!");
            Assert.AreEqual(0.0f, testingTarget.TextColor.A, "Should be equal!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextUtilsShadowParametersTextColor END (OK)");
        }
示例#5
0
        public void TextUtilsCreateShadow()
        {
            tlog.Debug(tag, $"TextUtilsCreateShadow START");

            var testingTarget = new ShadowParameters();

            Assert.IsNotNull(testingTarget, "Can't create success object ShadowParameters");
            Assert.IsInstanceOf <ShadowParameters>(testingTarget, "Should be an instance of ShadowParameters type.");

            testingTarget.Input       = new PixelBuffer(30, 50, PixelFormat.A8);
            testingTarget.blendShadow = true;

            var result = TextUtils.CreateShadow(testingTarget);

            Assert.IsNotNull(result, "Can't create success object PixelBuffer");
            Assert.IsInstanceOf <PixelBuffer>(result, "Should be an instance of PixelBuffer type.");

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextUtilsCreateShadow END (OK)");
        }
示例#6
0
        public void TextUtilsShadowParametersColor()
        {
            tlog.Debug(tag, $"TextUtilsShadowParametersColor START");

            var testingTarget = new ShadowParameters();

            Assert.IsNotNull(testingTarget, "Can't create success object ShadowParameters");
            Assert.IsInstanceOf <ShadowParameters>(testingTarget, "Should be an instance of ShadowParameters type.");

            testingTarget.Input = new PixelBuffer(30, 50, PixelFormat.A8);

            testingTarget.Color = new Vector4(0.3f, 0.8f, 1.0f, 0.0f);
            var color = new Vector4(0.3f, 0.8f, 1.0f, 0.0f);

            Assert.AreEqual(true, CheckColor(color, testingTarget.Color), "Should be true!");

            color.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"TextUtilsShadowParametersColor END (OK)");
        }
示例#7
0
        public void TextUtilsShadowParametersblendShadow()
        {
            tlog.Debug(tag, $"TextUtilsShadowParametersblendShadow START");

            var testingTarget = new ShadowParameters();

            Assert.IsNotNull(testingTarget, "Can't create success object ShadowParameters");
            Assert.IsInstanceOf <ShadowParameters>(testingTarget, "Should be an instance of ShadowParameters type.");

            testingTarget.blendShadow = true;

            try
            {
                var result = testingTarget.blendShadow;
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception: Failed!");
            }

            testingTarget.Dispose();
            tlog.Debug(tag, $"TextUtilsShadowParametersblendShadow END (OK)");
        }