Skip to content
This repository was archived by the owner on Aug 13, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .idea/androidTestResultsUserPreferences.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ android {
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion"
androidTestImplementation ("androidx.test.espresso:espresso-core:$rootProject.espressoVersion", {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation ("androidx.test.espresso:espresso-core:$rootProject.espressoVersion", {

})
androidTestImplementation "androidx.test.ext:junit:$rootProject.androidxJunitVersion"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.example.frogger2340project;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.RadioButton;

import androidx.appcompat.app.AppCompatActivity;

public class PlayerConfig extends AppCompatActivity {

private EditText playerNameText;
Expand Down Expand Up @@ -80,4 +80,6 @@ public void startGame(View view) {
public static String getPlayerName() {
return playerName;
}

public String getDifficulty() {return difficulty;}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
package com.example.frogger2340project;

import static org.junit.Assert.*;
import static org.junit.Assert.assertEquals;

import android.widget.RadioButton;

import org.junit.Test;

// import androidx.test.ext.junit.runners.AndroidJUnit4;

// @RunWith(AndroidJUnit4.class)
public class ShayahnTestCases {

@Test
public void onDifficultyButtonClicked() {
MainActivity activity = new MainActivity();
PlayerConfig config = new PlayerConfig();
RadioButton rb = (RadioButton) activity.findViewById(R.id.Easy);
config.onDifficultyButtonClicked(rb);
assertEquals("Easy", config.getDifficulty());
}

@Test
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ ext {
junitVersion = '4.13.2'
espressoVersion = '3.4.0'
androidxJunitVersion = '1.1.2'
testImplementation = "androidx.arch.core:core-testing:2.1.0"
}