コード例 #1
0
        public void CloneIsDeep()
        {
            var expected = new TextGraphicsOptions();
            TextGraphicsOptions actual = expected.DeepClone();

            actual.AlphaCompositionMode   = PixelAlphaCompositionMode.DestAtop;
            actual.Antialias              = false;
            actual.AntialiasSubpixelDepth = 23;
            actual.ApplyKerning           = false;
            actual.BlendPercentage        = .25F;
            actual.ColorBlendingMode      = PixelColorBlendingMode.HardLight;
            actual.DpiX = 46F;
            actual.DpiY = 52F;
            actual.HorizontalAlignment = HorizontalAlignment.Center;
            actual.TabWidth            = 3F;
            actual.VerticalAlignment   = VerticalAlignment.Bottom;
            actual.WrapTextWidth       = 42F;

            Assert.NotEqual(expected.AlphaCompositionMode, actual.AlphaCompositionMode);
            Assert.NotEqual(expected.Antialias, actual.Antialias);
            Assert.NotEqual(expected.AntialiasSubpixelDepth, actual.AntialiasSubpixelDepth);
            Assert.NotEqual(expected.ApplyKerning, actual.ApplyKerning);
            Assert.NotEqual(expected.BlendPercentage, actual.BlendPercentage);
            Assert.NotEqual(expected.ColorBlendingMode, actual.ColorBlendingMode);
            Assert.NotEqual(expected.DpiX, actual.DpiX);
            Assert.NotEqual(expected.DpiY, actual.DpiY);
            Assert.NotEqual(expected.HorizontalAlignment, actual.HorizontalAlignment);
            Assert.NotEqual(expected.TabWidth, actual.TabWidth);
            Assert.NotEqual(expected.VerticalAlignment, actual.VerticalAlignment);
            Assert.NotEqual(expected.WrapTextWidth, actual.WrapTextWidth);
        }
コード例 #2
0
        public void NonDefaultClone()
        {
            var expected = new TextGraphicsOptions
            {
                AlphaCompositionMode   = PixelAlphaCompositionMode.DestAtop,
                Antialias              = false,
                AntialiasSubpixelDepth = 23,
                ApplyKerning           = false,
                BlendPercentage        = .25F,
                ColorBlendingMode      = PixelColorBlendingMode.HardLight,
                DpiX = 46F,
                DpiY = 52F,
                HorizontalAlignment = HorizontalAlignment.Center,
                TabWidth            = 3F,
                VerticalAlignment   = VerticalAlignment.Bottom,
                WrapTextWidth       = 42F
            };

            TextGraphicsOptions actual = expected.DeepClone();

            Assert.Equal(expected.AlphaCompositionMode, actual.AlphaCompositionMode);
            Assert.Equal(expected.Antialias, actual.Antialias);
            Assert.Equal(expected.AntialiasSubpixelDepth, actual.AntialiasSubpixelDepth);
            Assert.Equal(expected.ApplyKerning, actual.ApplyKerning);
            Assert.Equal(expected.BlendPercentage, actual.BlendPercentage);
            Assert.Equal(expected.ColorBlendingMode, actual.ColorBlendingMode);
            Assert.Equal(expected.DpiX, actual.DpiX);
            Assert.Equal(expected.DpiY, actual.DpiY);
            Assert.Equal(expected.HorizontalAlignment, actual.HorizontalAlignment);
            Assert.Equal(expected.TabWidth, actual.TabWidth);
            Assert.Equal(expected.VerticalAlignment, actual.VerticalAlignment);
            Assert.Equal(expected.WrapTextWidth, actual.WrapTextWidth);
        }