Ejemplo n.º 1
0
        public void ToStringTest()
        {
            var units        = r.Next(-15, 15, 0);
            var unitCategory = EnumHelpers.GetRandomValue <CSSUnit>(CSSUnit.None);
            var lu           = new CSSLengthUnit(units, unitCategory);
            var expected     = $"{units}{CSSUnitTypeAttribute.GetUnitSuffix<CSSUnit>(unitCategory)}";

            Assert.AreEqual(expected, lu.ToString());
        }
Ejemplo n.º 2
0
        public void WidthCustom()
        {
            var propertyIndex = 1;
            var expectedValue = new CSSLengthUnit(r.Next(1, 99), CSSUnit.Percent);

            var src = new RootOptions {
                Width = expectedValue
            };
            var so = PopulateOptions(src);

            AssertPopulatedProperty(so, propertyIndex, expectedValue.ToString());
        }
        public void BorderWidthCustom()
        {
            var propertyIndex = 4;
            var expectedValue = new CSSLengthUnit(r.Next(10, 24), CSSUnit.Points);

            var src = new SuggestedActionsOptions {
                BorderWidth = expectedValue
            };
            var so = PopulateOptions(src);

            AssertPopulatedProperty(so, propertyIndex, expectedValue.ToString());
        }
        public void BorderRadiusCustom()
        {
            var units = r.Next(5, 15,
                               AvatarCommonOptions.Defaults.BorderRadius.Units / 5);
            var expectedRaw = new CSSLengthUnit($"'{units * 5}%'");
            var aa          = new AvatarCommonOptions {
                BorderRadius = expectedRaw
            };
            var so = PopulateOptions(aa);

            Assert.AreEqual(
                expectedRaw.ToString(),
                so[propertyNames[0]]);
        }