/*
 * Copyright (C) 2015 Pedro Vicente Gomez Sanchez.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.github.pedrovgs.lynx;

import android.view.View;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

import static org.junit.Assert.assertEquals;

/**
 * @author Pedro Vicente Gómez Sánchez.
 */
@Config(emulateSdk = 18) @RunWith(RobolectricTestRunner.class) public class LynxActivityTest {

  private LynxActivity lynxActivity;

  @Before public void setUp() {
    lynxActivity = Robolectric.buildActivity(LynxActivity.class).create().resume().get();
  }

  @Test public void shouldShowLynxViewAsVisible() {
    LynxView lynxView = (LynxView) lynxActivity.findViewById(R.id.lynx_view);

    int lynxViewVisibility = lynxView.getVisibility();
    
    assertEquals(View.VISIBLE, lynxViewVisibility);
  }
}

@@ -667,16 +667,47 @@
 w.View;%0A
+import android.view.ViewGroup;%0A
 import o
@@ -1339,17 +1339,19 @@
 w = 
-(
+get
 LynxView
 ) ly
@@ -1350,163 +1350,644 @@
 View
-) lynxActivity.findViewById(R.id.
+();%0A%0A    int lynxViewVisibility = lynxView.getVisibility();%0A%0A    assertEquals(View.VISIBLE, 
 lynx
-_view);%0A%0A    int lynxViewVisibility = lynxView.getVisibility()
+ViewVisibility);%0A  %7D%0A%0A  @Test public void shouldShowLynxViewUsingMatchParentAsConfiguration() %7B%0A    LynxView lynxView = getLynxView();%0A%0A    ViewGroup.LayoutParams layoutParams = lynxView.getLayoutParams();%0A    int lynxViewHeight = layoutParams.height;%0A    int lynxViewWidth = layoutParams.width
 ;%0A
+%0A
     
-%0A    assertEquals(View.VISIBLE, lynxViewVisibility
+assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, lynxViewHeight);%0A    assertEquals(ViewGroup.LayoutParams.MATCH_PARENT, lynxViewWidth);%0A  %7D%0A%0A  private LynxView getLynxView() %7B%0A    return (LynxView) lynxActivity.findViewById(R.id.lynx_view
 );%0A 

Add test to check LynxView layout_height and layout_width configuration in LynxActivity