package com.ohtu.wearable.wearabledataservice;

import android.app.Activity;
import android.hardware.Sensor;
import android.support.wearable.view.WearableListView;
import com.ohtu.wearable.wearabledataservice.fragments.FragmentOne;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.util.SupportFragmentTestUtil;

import java.util.List;

import static org.junit.Assert.assertNotNull;

@RunWith(CustomRobolectricRunner.class)
public class FragmentOneTest {
    private FragmentOne fragment;


    @Before
    public void setUp() {
        fragment = new FragmentOne();
        SupportFragmentTestUtil.startFragment(fragment);
    }


    @Test
    public void shouldNotBeNull() throws Exception {
        assertNotNull( fragment );
    }

    @Test
    public void sensorListShouldNotBeNull() throws Exception {
        List<Sensor> sensors = fragment.getSensors();
        assertNotNull(sensors);
    }

    @Test
    public void activityShouldNotBeNull() throws Exception {
        Activity activity = fragment.getActivity();
        assertNotNull(activity);
    }

    @Test
    public void listViewIsCreated() throws Exception {
        Activity activity = fragment.getActivity();
        WearableListView listView = (WearableListView) fragment.getActivity().findViewById(R.id.wearable_list);
        assertNotNull(listView);
    }
}

@@ -1117,274 +1117,6 @@
  %7D%0A%0A
-    @Test%0A    public void listViewIsCreated() throws Exception %7B%0A        Activity activity = fragment.getActivity();%0A        WearableListView listView = (WearableListView) fragment.getActivity().findViewById(R.id.wearable_list);%0A        assertNotNull(listView);%0A    %7D%0A
 %7D%0A

Update fragmentOne tests