public void testPropertiesAnimationComputeEffects() {
$(e)
.html(
"<div id='parent' style='background-color: yellow; width: 100px; height: 200px; top:130px; position: absolute; left: 130px'><p id='child' style='background-color: pink; width: 100px; height: 100px; position: absolute; padding: 5px; margin: 0px'>Content 1</p></div>");
GQuery g = $("#child");
Properties prop1;
assertEquals("cssprop=marginTop value=-110px start=0 end=-110 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "marginTop", "-110px",
false).toString());
assertEquals("cssprop=marginLeft value=-110px start=0 end=-110 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "marginLeft", "-110px",
false).toString());
assertEquals("cssprop=top value=50% start=0 end=50 unit=%",
PropertiesAnimation.computeFxProp(g.get(0), "top", "50%", false)
.toString());
assertEquals("cssprop=left value=50% start=0 end=50 unit=%",
PropertiesAnimation.computeFxProp(g.get(0), "left", "50%", false)
.toString());
assertEquals("cssprop=width value=174px start=100 end=174 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "width", "174px", false)
.toString());
assertEquals("cssprop=height value=174px start=100 end=174 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "height", "174px", false)
.toString());
assertEquals("cssprop=padding value=20px start=5 end=20 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "padding", "20px", false)
.toString());
prop1 = GQuery.$$("marginTop: '-110px', marginLeft: '-110px', top: '50%', left: '50%', width: '174px', height: '174px', padding: '20px'");
PropertiesAnimation an = new PropertiesAnimation(EasingCurve.swing, g.get(0), prop1);
an.onStart();
an.onComplete();
assertEquals("cssprop=marginTop value=0 start=-110 end=0 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "marginTop", "0", false)
.toString());
assertEquals("cssprop=marginLeft value=0 start=-110 end=0 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "marginLeft", "0", false)
.toString());
assertEquals("cssprop=top value=0% start=50 end=0 unit=%", PropertiesAnimation
.computeFxProp(g.get(0), "top", "0%", false).toString());
assertEquals("cssprop=left value=0% start=50 end=0 unit=%",
PropertiesAnimation.computeFxProp(g.get(0), "left", "0%", false)
.toString());
assertEquals("cssprop=width value=100px start=174 end=100 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "width", "100px", false)
.toString());
assertEquals("cssprop=height value=100px start=174 end=100 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "height", "100px", false)
.toString());
assertEquals("cssprop=padding value=5px start=20 end=5 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "padding", "5px", false)
.toString());
prop1 = GQuery.$$("marginTop: '0', marginLeft: '0', top: '0%', left: '0%', width: '100px', height: '100px', padding: '5px'");
an = new PropertiesAnimation(EasingCurve.swing, g.get(0), prop1);
an.onStart();
an.onComplete();
assertEquals("cssprop=marginTop value=-110px start=0 end=-110 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "marginTop", "-110px",
false).toString());
assertEquals("cssprop=marginLeft value=-110px start=0 end=-110 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "marginLeft", "-110px",
false).toString());
assertEquals("cssprop=top value=50% start=0 end=50 unit=%",
PropertiesAnimation.computeFxProp(g.get(0), "top", "50%", false)
.toString());
assertEquals("cssprop=left value=50% start=0 end=50 unit=%",
PropertiesAnimation.computeFxProp(g.get(0), "left", "50%", false)
.toString());
assertEquals("cssprop=width value=174px start=100 end=174 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "width", "174px", false)
.toString());
assertEquals("cssprop=height value=174px start=100 end=174 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "height", "174px", false)
.toString());
assertEquals("cssprop=padding value=20px start=5 end=20 unit=px",
PropertiesAnimation.computeFxProp(g.get(0), "padding", "20px", false)
.toString());
}