diff --git a/app/src/androidTest/java/com/symphony/mrfit/ui/CalendarActivityTest.kt b/app/src/androidTest/java/com/symphony/mrfit/ui/CalendarActivityTest.kt new file mode 100644 index 0000000..5b87b9d --- /dev/null +++ b/app/src/androidTest/java/com/symphony/mrfit/ui/CalendarActivityTest.kt @@ -0,0 +1,18 @@ +package com.symphony.mrfit.ui + +import org.junit.Assert.* + +import org.junit.Test + +class CalendarActivityTest { + //behavioral + @Test + fun onCreate() { + } + @Test + fun onStart() { + } + @Test + fun onSupportNavigateUp() { + } +} \ No newline at end of file diff --git a/app/src/androidTest/java/com/symphony/mrfit/ui/CurrentWorkoutActivityTest.kt b/app/src/androidTest/java/com/symphony/mrfit/ui/CurrentWorkoutActivityTest.kt new file mode 100644 index 0000000..3eff07c --- /dev/null +++ b/app/src/androidTest/java/com/symphony/mrfit/ui/CurrentWorkoutActivityTest.kt @@ -0,0 +1,56 @@ +package com.symphony.mrfit.ui +import android.content.ComponentName +import android.content.Context +import android.content.Intent +import android.os.Bundle +import androidx.test.core.app.ActivityScenario +import androidx.test.core.app.ApplicationProvider +import androidx.test.ext.junit.rules.activityScenarioRule +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.rule.ActivityTestRule +import org.junit.After +import org.junit.Assert.* +import org.junit.Before +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.junit.Assert.assertEquals + + + + +@RunWith(AndroidJUnit4::class) +class CurrentWorkoutActivityTest { + //behavioral + @Test + fun onCreate() { + + } + //behavioral + @Test + fun onStart() { + + } + @Test + fun gotoHome() { + // Start the activity + val context = ApplicationProvider.getApplicationContext() + val intent = Intent(context, HomeActivity::class.java) + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK) + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + + val expectedFlags = (Intent.FLAG_ACTIVITY_CLEAR_TOP or + Intent.FLAG_ACTIVITY_CLEAR_TASK or + Intent.FLAG_ACTIVITY_NEW_TASK) + + assertEquals(expectedFlags, intent.flags) + assertEquals(context.packageName, intent.component?.packageName) + assertEquals(HomeActivity::class.java.name, intent.component?.className) + } + //behavioral + @Test + fun onSupportNavigateUp() { + + } +} \ No newline at end of file diff --git a/app/src/androidTest/java/com/symphony/mrfit/ui/CustomExercisesActivityTest.kt b/app/src/androidTest/java/com/symphony/mrfit/ui/CustomExercisesActivityTest.kt new file mode 100644 index 0000000..b4086ae --- /dev/null +++ b/app/src/androidTest/java/com/symphony/mrfit/ui/CustomExercisesActivityTest.kt @@ -0,0 +1,27 @@ +package com.symphony.mrfit.ui + +import androidx.test.core.app.ApplicationProvider +import com.symphony.mrfit.data.exercise.ExerciseViewModel +import com.symphony.mrfit.data.model.Exercise +import org.junit.Assert.* +import org.junit.Before + +import org.junit.Test + +class CustomExercisesActivityTest { + //behavioral + //TODO + @Test + fun onCreate() { + } + @Test + fun onStart() { + } + @Test + fun onSupportNavigateUp() { + } + @Test + fun deleteExercise(){ + } + +} \ No newline at end of file diff --git a/app/src/androidTest/java/com/symphony/mrfit/ui/GoalsActivityTest.kt b/app/src/androidTest/java/com/symphony/mrfit/ui/GoalsActivityTest.kt new file mode 100644 index 0000000..e7495b9 --- /dev/null +++ b/app/src/androidTest/java/com/symphony/mrfit/ui/GoalsActivityTest.kt @@ -0,0 +1,24 @@ +package com.symphony.mrfit.ui + +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.matcher.ViewMatchers.isDisplayed +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.ext.junit.rules.activityScenarioRule +import org.junit.Rule +import org.junit.Test +import com.symphony.mrfit.R + + + + +class GoalsActivityTest { + @get:Rule + var activityScenarioRule = activityScenarioRule() + + //TODO + @Test + fun checkActivityVisibility() { + } +} + diff --git a/app/src/androidTest/java/com/symphony/mrfit/ui/HelperTest.kt b/app/src/androidTest/java/com/symphony/mrfit/ui/HelperTest.kt new file mode 100644 index 0000000..02b8e8d --- /dev/null +++ b/app/src/androidTest/java/com/symphony/mrfit/ui/HelperTest.kt @@ -0,0 +1,31 @@ +package com.symphony.mrfit.ui + +import android.app.Activity +import android.view.View +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.* +import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation +import com.google.android.material.snackbar.Snackbar +import org.hamcrest.CoreMatchers.* +import org.junit.Assert.assertEquals +import org.junit.Before +import org.junit.Test +import java.util.* + + +class HelperTest{ + private lateinit var activity: Activity + + //test functionality of calendar method + @Test + fun toCalendarconvertsDatetoCalendar() { + val date = Date() + val cal = Helper.toCalendar(date) + assertThat(cal.get(Calendar.YEAR), `is`(Calendar.getInstance().get(Calendar.YEAR))) + assertThat(cal.get(Calendar.MONTH), `is`(Calendar.getInstance().get(Calendar.MONTH))) + assertThat(cal.get(Calendar.DAY_OF_MONTH), `is`(Calendar.getInstance().get(Calendar.DAY_OF_MONTH)) + ) + } +} \ No newline at end of file