package ru.rambler.android.grid;

import android.util.TypedValue;
import android.view.Gravity;
import org.junit.Test;

import static org.junit.Assert.assertEquals;


public class LineTest {

    @Test
    public void testInstantiate() throws Exception {
        Line left = Line.fromLeft(1, TypedValue.COMPLEX_UNIT_DIP);
        assertEquals(Gravity.LEFT, left.getGravity());
        assertEquals(1, left.getMargin());

        Line right = Line.fromRight(2, TypedValue.COMPLEX_UNIT_DIP);
        assertEquals(Gravity.RIGHT, right.getGravity());
        assertEquals(2, right.getMargin());

        Line top = Line.fromTop(3, TypedValue.COMPLEX_UNIT_DIP);
        assertEquals(Gravity.TOP, top.getGravity());
        assertEquals(3, top.getMargin());

        Line bottom = Line.fromBottom(4, TypedValue.COMPLEX_UNIT_DIP);
        assertEquals(Gravity.BOTTOM, bottom.getGravity());
        assertEquals(4, bottom.getMargin());


    }
}
@@ -214,13 +214,9 @@
 oid 
-testI
+i
 nsta
@@ -221,16 +221,37 @@
 tantiate
+Left_setCorrectValues
 () throw
@@ -323,32 +323,33 @@
 PLEX_UNIT_DIP);%0A
+%0A
         assertEq
@@ -422,32 +422,119 @@
 t.getMargin());%0A
+    %7D%0A%0A    @Test%0A    public void instantiateRight_setCorrectValues() throws Exception %7B
 %0A        Line ri
@@ -579,32 +579,33 @@
 PLEX_UNIT_DIP);%0A
+%0A
         assertEq
@@ -681,32 +681,117 @@
 t.getMargin());%0A
+    %7D%0A%0A    @Test%0A    public void instantiateTop_setCorrectValues() throws Exception %7B
 %0A        Line to
@@ -832,32 +832,33 @@
 PLEX_UNIT_DIP);%0A
+%0A
         assertEq
@@ -936,16 +936,104 @@
 gin());%0A
+    %7D%0A%0A    @Test%0A    public void instantiateBottom_setCorrectValues() throws Exception %7B
 %0A       
@@ -1096,16 +1096,17 @@
 T_DIP);%0A
+%0A
         
@@ -1205,13 +1205,13 @@
 ));%0A
-%0A%0A
     %7D%0A
+%0A%0A
 %7D

Split instantiate tests