GetFloatValue() public méthode

public GetFloatValue ( CssPrimitiveType unitType ) : double
unitType CssPrimitiveType
Résultat double
    public void TestGradValue()
    {
        angle = new CssPrimitiveAngleValue("100grad", false);
                Assert.AreEqual(100, angle.GetFloatValue(CssPrimitiveType.Grad));
                Assert.AreEqual(90, angle.GetFloatValue(CssPrimitiveType.Deg));
                Assert.AreEqual(Math.PI / 2, angle.GetFloatValue(CssPrimitiveType.Rad));

                angle = new CssPrimitiveAngleValue("600grad", false);
                Assert.AreEqual(200, angle.GetFloatValue(CssPrimitiveType.Grad));
    }
    public void TestRadValue()
    {
        angle = new CssPrimitiveAngleValue("1rad", false);
                Assert.AreEqual(1, angle.GetFloatValue(CssPrimitiveType.Rad));
                Assert.AreEqual(1 * 180 / Math.PI, angle.GetFloatValue(CssPrimitiveType.Deg));
                Assert.AreEqual(1 * 200 / Math.PI, angle.GetFloatValue(CssPrimitiveType.Grad));

                angle = new CssPrimitiveAngleValue("-2rad", false);
                Assert.AreEqual(2*Math.PI - 2, angle.GetFloatValue(CssPrimitiveType.Rad));

                angle = new CssPrimitiveAngleValue("8rad", false);
                Assert.AreEqual(8%(2*Math.PI), angle.GetFloatValue(CssPrimitiveType.Rad));
    }
    public void TestDegValue()
    {
        angle = new CssPrimitiveAngleValue("90deg", false);
                Assert.AreEqual(90, angle.GetFloatValue(CssPrimitiveType.Deg));
                Assert.AreEqual(100, angle.GetFloatValue(CssPrimitiveType.Grad));
                Assert.AreEqual(Math.PI/2, angle.GetFloatValue(CssPrimitiveType.Rad));

                angle = new CssPrimitiveAngleValue("47", false);
                Assert.AreEqual(47, angle.GetFloatValue(CssPrimitiveType.Deg));

                angle = new CssPrimitiveAngleValue("385deg", false);
                Assert.AreEqual(25, angle.GetFloatValue(CssPrimitiveType.Deg));

                angle = new CssPrimitiveAngleValue("-90deg", false);
                Assert.AreEqual(270, angle.GetFloatValue(CssPrimitiveType.Deg));
    }