<commit_before>package ca.ualberta.cs.cmput301t02project.test;

import ca.ualberta.cs.cmput301t02project.ProjectApplication;
import ca.ualberta.cs.cmput301t02project.R;
import ca.ualberta.cs.cmput301t02project.activity.BrowseReplyCommentsActivity;
import ca.ualberta.cs.cmput301t02project.model.CommentListModel;
import ca.ualberta.cs.cmput301t02project.model.CommentModel;
import ca.ualberta.cs.cmput301t02project.view.CommentListAdapterAbstraction;
import android.location.Location;
import android.test.ActivityInstrumentationTestCase2;
import android.test.ViewAsserts;
import android.widget.ListView;
import android.widget.TextView;

public class BrowseReplyCommentsActivityTest extends ActivityInstrumentationTestCase2<BrowseReplyCommentsActivity> {

	public BrowseReplyCommentsActivityTest() {
		super(BrowseReplyCommentsActivity.class);
	}

	public CommentModel initializeComment() {
		String loc = "Location Intialization";
		Location currentLocation;
		Location myLocation;
		currentLocation = new Location(loc);
		myLocation = new Location(loc);

		CommentModel comment = new CommentModel("comment", currentLocation, "username");
		
		ProjectApplication.setCurrentComment(comment);
		ProjectApplication.setCurrentLocation(myLocation);
		
		return comment;
	}

	/* Test for use case 4 */
	public void testDisplayComment() {
		CommentModel comment = initializeComment();
		TextView view = (TextView) getActivity().findViewById(R.id.selected_comment);
		assertEquals("text should be displayed", comment.getText(), view.getText().toString());
	}

	/* Test for use case 4 */
	public void testVisibleTextView() {
		TextView view = (TextView) getActivity().findViewById(R.id.selected_comment);
		BrowseReplyCommentsActivity activity = getActivity();
		ViewAsserts.assertOnScreen(activity.getWindow().getDecorView(), view);

	}

	/* Test for use case 4 */
	public void testDisplayReplies() {
		CommentModel comment = initializeComment();
		CommentListModel comments = new CommentListModel();
		comments.add(comment);
		ProjectApplication.setCurrentCommentList(comments);

		ListView view = (ListView) getActivity().findViewById(R.id.replyListView);
		assertEquals("text should be displayed", comment.toString(), view.getAdapter().getItem(0).toString());

	}

	/* Test for use case 4 */
	public void testVisibleListView() {
		ListView view = (ListView) getActivity().findViewById(R.id.replyListView);
		BrowseReplyCommentsActivity activity = getActivity();
		ViewAsserts.assertOnScreen(activity.getWindow().getDecorView(), view);

	}

}<commit_msg>Finished tests for Use Case 5<commit_after>package ca.ualberta.cs.cmput301t02project.test;

import ca.ualberta.cs.cmput301t02project.ProjectApplication;
import ca.ualberta.cs.cmput301t02project.R;
import ca.ualberta.cs.cmput301t02project.activity.BrowseReplyCommentsActivity;
import ca.ualberta.cs.cmput301t02project.model.CommentListModel;
import ca.ualberta.cs.cmput301t02project.model.CommentModel;
import ca.ualberta.cs.cmput301t02project.view.CommentListAdapterAbstraction;
import android.location.Location;
import android.test.ActivityInstrumentationTestCase2;
import android.test.ViewAsserts;
import android.widget.ListView;
import android.widget.TextView;

public class BrowseReplyCommentsActivityTest extends ActivityInstrumentationTestCase2<BrowseReplyCommentsActivity> {

	public BrowseReplyCommentsActivityTest() {
		super(BrowseReplyCommentsActivity.class);
	}

	public CommentModel initializeComment() {
		String loc = "Location Intialization";
		Location currentLocation;
		Location myLocation;
		currentLocation = new Location(loc);
		myLocation = new Location(loc);

		CommentModel comment = new CommentModel("comment", currentLocation, "username");

		ProjectApplication.setCurrentComment(comment);
		ProjectApplication.setCurrentLocation(myLocation);

		return comment;
	}

	/* Test for use case 5 */
	public void testDisplaySelectedComment() {
		CommentModel comment = initializeComment();
		TextView view = (TextView) getActivity().findViewById(R.id.selected_comment);
		assertEquals("text should be displayed", comment.getText(), view.getText().toString());
	}

	/* Test for use case 5 */
	public void testVisibleTextView() {
		TextView view = (TextView) getActivity().findViewById(R.id.selected_comment);
		BrowseReplyCommentsActivity activity = getActivity();
		ViewAsserts.assertOnScreen(activity.getWindow().getDecorView(), view);

	}

	/* Test for use case 5 */
	public void testDisplayReplies() {
		CommentModel comment = initializeComment();
		CommentListModel comments = new CommentListModel();
		comments.add(comment);
		ProjectApplication.setCurrentCommentList(comments);

		ListView view = (ListView) getActivity().findViewById(R.id.replyListView);
		assertEquals("text should be displayed", comment.toString(), view.getAdapter().getItem(0).toString());

	}

	/* Test for use case 5 */
	public void testVisibleListView() {
		ListView view = (ListView) getActivity().findViewById(R.id.replyListView);
		BrowseReplyCommentsActivity activity = getActivity();
		ViewAsserts.assertOnScreen(activity.getWindow().getDecorView(), view);

	}

}
{'fraction_non_alphanumeric': 0.10437842064112587, 'fraction_numerical': 0.016614542611415168, 'mean_word_length': 6.480994152046784, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1571373', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1404, 'n_words': 287}