GetFloatValue() public method

public GetFloatValue ( CssPrimitiveType unitType ) : double
unitType CssPrimitiveType
return double
 public void TestMmValue()
 {
     length = new CssPrimitiveLengthValue("10mm", false);
             Assert.AreEqual(10, length.GetFloatValue(CssPrimitiveType.Mm));
             Assert.AreEqual(1, length.GetFloatValue(CssPrimitiveType.Cm));
             Assert.AreEqual(1/2.54D, length.GetFloatValue(CssPrimitiveType.In));
             Assert.AreEqual(1/2.54D * 6, length.GetFloatValue(CssPrimitiveType.Pc));
             Assert.AreEqual(1/2.54D * 72, length.GetFloatValue(CssPrimitiveType.Pt));
 }
 public void TestInValue()
 {
     length = new CssPrimitiveLengthValue("10in", false);
             Assert.AreEqual(10, length.GetFloatValue(CssPrimitiveType.In));
             Assert.AreEqual(10*2.54D, length.GetFloatValue(CssPrimitiveType.Cm));
             Assert.AreEqual(100*2.54D, length.GetFloatValue(CssPrimitiveType.Mm));
             Assert.AreEqual(60, length.GetFloatValue(CssPrimitiveType.Pc));
             Assert.AreEqual(720, length.GetFloatValue(CssPrimitiveType.Pt));
 }
 public void TestPcValue()
 {
     length = new CssPrimitiveLengthValue("10pc", false);
             Assert.AreEqual(10, length.GetFloatValue(CssPrimitiveType.Pc), "To pc");
             Assert.AreEqual(10/6D*2.54D, length.GetFloatValue(CssPrimitiveType.Cm), "To cm");
             Assert.AreEqual(100/6D*2.54D, length.GetFloatValue(CssPrimitiveType.Mm), "To mm");
             Assert.AreEqual(10/6D, length.GetFloatValue(CssPrimitiveType.In), "To in");
             Assert.AreEqual(120, length.GetFloatValue(CssPrimitiveType.Pt), "To pt");
 }
 public void TestExValue()
 {
     length = new CssPrimitiveLengthValue("10ex", false);
             Assert.AreEqual(10, length.GetFloatValue(CssPrimitiveType.Exs), "To ex");
 }
 public void TestUnitLessValue()
 {
     length = new CssPrimitiveLengthValue("10", false);
             Assert.AreEqual(10, length.GetFloatValue(CssPrimitiveType.Number));
 }
    public void TestPxValue()
    {
        length = new CssPrimitiveLengthValue("12px", false);
                Assert.AreEqual(12, length.GetFloatValue(CssPrimitiveType.Px));
                try
                {
                    length.GetCounterValue();
          Assert.Fail("length.GetCounterValue()");
                }
                catch{}

                try
                {
                    length.GetFloatValue(CssPrimitiveType.Ems);
                    Assert.Fail("length.GetFloatValue(CssPrimitiveType.Ems)");
                }
                catch(DomException e)
                {
                    Assert.AreEqual(DomExceptionType.InvalidAccessErr, e.Code);
                }
    }
 public void TestPercentageValue()
 {
     length = new CssPrimitiveLengthValue("10%", false);
             Assert.AreEqual(10, length.GetFloatValue(CssPrimitiveType.Percentage), "To %");
 }