/*
 * Copyright 2019 Michael Rozumyanskiy
 *
 * 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 io.michaelrocks.paranoid.sample;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

@RunWith(AndroidJUnit4.class)
@LargeTest
public class MainActivityTest {
  @Rule
  public ActivityTestRule<MainActivity> activityRule = new ActivityTestRule<>(MainActivity.class);

  @Test
  public void textViewsHaveProperText() {
    onView(withId(R.id.questionTextView))
        .check(matches(withText("Q:\r\nHow does it work?")));
    onView(withId(R.id.answerTextView))
        .check(matches(withText("A:\r\nIt's magic! ¯\\_(ツ)_/¯")));
    onView(withId(R.id.showDialogButton))
        .check(matches(withText("Show dialog")));
  }
}

@@ -15,10 +15,10 @@
 t 20
+2
 1
-9
  Mic
@@ -720,16 +720,75 @@
 nWith;%0A%0A
+import androidx.test.ext.junit.rules.ActivityScenarioRule;%0A
 import a
@@ -876,52 +876,8 @@
 est;
-%0Aimport androidx.test.rule.ActivityTestRule;
 %0A%0Aim
@@ -1228,28 +1228,32 @@
 lic Activity
-Test
+Scenario
 Rule%3CMainAct
@@ -1267,16 +1267,24 @@
 activity
+Scenario
 Rule = n
@@ -1294,20 +1294,24 @@
 Activity
-Test
+Scenario
 Rule%3C%3E(M

Fix a deprecation warning