From 611cf2934cb4358c4480880570534a1e090c02be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Berk=20Ba=C5=9Fo=C4=9Flu?= Date: Tue, 27 Nov 2018 17:30:53 -0500 Subject: [PATCH] Added comments --- .../.idea/caches/build_file_checksums.ser | Bin 537 -> 537 bytes .../olympus/olympusservices/LogInTest.java | 22 ----- .../olympus/olympusservices/SignUpTest.java | 90 ------------------ .../olympus/olympusservices/BookingTest.java | 36 +++++++ 4 files changed, 36 insertions(+), 112 deletions(-) delete mode 100644 OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java delete mode 100644 OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/SignUpTest.java diff --git a/OlympusServices/.idea/caches/build_file_checksums.ser b/OlympusServices/.idea/caches/build_file_checksums.ser index 66d481e50942458fe6b32ac43428c079c4495dce..a72ac4f80232789a26d38690c2e779bbdd3d1f86 100644 GIT binary patch delta 66 zcmV-I0KNa21epYom;_flQAm-Ti4Q14I$TwAWpZ;|VqtW3Xp^=9Hj^a*a1*WPSOtKy Y?=A2okcKFiw>@+K5tF|G8 Sb6iPwVQyiQGyyh~>;Wye0~S;O diff --git a/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java b/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java deleted file mode 100644 index 0487845..0000000 --- a/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/LogInTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.uottawa.olympus.olympusservices; - -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; - - -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; - - -@RunWith(AndroidJUnit4.class) -public class LogInTest { - - @Rule - public ActivityTestRule mActivityTestRule = new ActivityTestRule(LogIn.class); - - @Test - public void checkSignIn() throws Exception{ - - } -} \ No newline at end of file diff --git a/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/SignUpTest.java b/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/SignUpTest.java deleted file mode 100644 index b299158..0000000 --- a/OlympusServices/app/src/androidTest/java/com/uottawa/olympus/olympusservices/SignUpTest.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.uottawa.olympus.olympusservices; - -import android.support.test.rule.ActivityTestRule; -import android.support.test.runner.AndroidJUnit4; -import android.widget.TextView; - -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static android.support.test.espresso.Espresso.onData; -import static android.support.test.espresso.Espresso.onView; -import static android.support.test.espresso.action.ViewActions.click; -import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; -import static android.support.test.espresso.action.ViewActions.typeText; -import static android.support.test.espresso.matcher.ViewMatchers.withId; -import static android.support.test.espresso.matcher.ViewMatchers.withSpinnerText; -import static java.util.regex.Pattern.matches; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.instanceOf; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.core.AllOf.allOf; -import static org.junit.Assert.*; - -@RunWith(AndroidJUnit4.class) -public class SignUpTest { - - @Rule - public ActivityTestRule mActivityTestRule = new ActivityTestRule(SignUp.class); - private SignUp mActivity=null; - private TextView text; - - @Before - public void setUp() throws Exception { - mActivity = mActivityTestRule.getActivity(); - } - - @Test - public void checkSignUp1() throws Exception{ - onView(withId(R.id.UsernameInput)).perform(typeText("John123"), closeSoftKeyboard()); - onView(withId(R.id.PasswordInput)).perform(typeText("1234567890"), closeSoftKeyboard()); - onView(withId(R.id.FirstNameInput)).perform(typeText("John"), closeSoftKeyboard()); - onView(withId(R.id.LastNameInput)).perform(typeText("Doe"), closeSoftKeyboard()); - onView(withId(R.id.SignUp)).perform(click()); - } - - @Test - public void checkSignUp2() throws Exception{ - onView(withId(R.id.RoleInput)).perform(click()); - onData(allOf(is(instanceOf(String.class)), is("Service Provider"))).perform(click()); - onView(withId(R.id.UsernameInput)).perform(typeText("Service123"), closeSoftKeyboard()); - onView(withId(R.id.PasswordInput)).perform(typeText("1234567890"), closeSoftKeyboard()); - onView(withId(R.id.FirstNameInput)).perform(typeText("Jane"), closeSoftKeyboard()); - onView(withId(R.id.LastNameInput)).perform(typeText("Doe"), closeSoftKeyboard()); - onView(withId(R.id.SignUp)).perform(click()); - } - - @Test - public void checkSignUp3() throws Exception{ - onView(withId(R.id.UsernameInput)).perform(typeText(""), closeSoftKeyboard()); - onView(withId(R.id.PasswordInput)).perform(typeText(""), closeSoftKeyboard()); - onView(withId(R.id.FirstNameInput)).perform(typeText(""), closeSoftKeyboard()); - onView(withId(R.id.LastNameInput)).perform(typeText(""), closeSoftKeyboard()); - onView(withId(R.id.SignUp)).perform(click()); - } - - @Test - public void checkSignUp4() throws Exception{ - onView(withId(R.id.UsernameInput)).perform(typeText("$$$$$$"), closeSoftKeyboard()); - onView(withId(R.id.PasswordInput)).perform(typeText("$$$$$$"), closeSoftKeyboard()); - onView(withId(R.id.FirstNameInput)).perform(typeText("$$$$$$"), closeSoftKeyboard()); - onView(withId(R.id.LastNameInput)).perform(typeText("$$$$$$"), closeSoftKeyboard()); - onView(withId(R.id.SignUp)).perform(click()); - } - - public void checkSignUp5() throws Exception{ - onView(withId(R.id.UsernameInput)).perform(typeText("user"), closeSoftKeyboard()); - onView(withId(R.id.PasswordInput)).perform(typeText("pass"), closeSoftKeyboard()); - onView(withId(R.id.FirstNameInput)).perform(typeText("Honda"), closeSoftKeyboard()); - onView(withId(R.id.LastNameInput)).perform(typeText("Gokuchi"), closeSoftKeyboard()); - onView(withId(R.id.SignUp)).perform(click()); - } - - @After - public void tearDown() throws Exception { - mActivity=null; - } -} \ No newline at end of file diff --git a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/BookingTest.java b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/BookingTest.java index 0faeded..5e20336 100644 --- a/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/BookingTest.java +++ b/OlympusServices/app/src/test/java/com/uottawa/olympus/olympusservices/BookingTest.java @@ -11,6 +11,9 @@ public class BookingTest { Booking book = new Booking(13, 30, 16, 0, 0, 0, 2019, serviceprovider, user, service); + /** + * tests starth input and its functions. + */ @Test public void testStarth() { assertEquals(13, book.getStarth()); @@ -18,6 +21,9 @@ public class BookingTest { assertNotEquals(13, book.getStarth()); } + /** + * tests startmin input and its functions. + */ @Test public void testStartmin() { assertEquals(30, book.getStartmin()); @@ -25,6 +31,9 @@ public class BookingTest { assertNotEquals(30, book.getStartmin()); } + /** + * tests Endh input and its functions. + */ @Test public void testEndh() { assertEquals(16, book.getEndh()); @@ -32,6 +41,9 @@ public class BookingTest { assertNotEquals(16, book.getEndh()); } + /** + * tests Endmin input and its functions. + */ @Test public void testEndmin() { assertEquals(0, book.getEndmin()); @@ -39,6 +51,9 @@ public class BookingTest { assertNotEquals(0, book.getEndmin()); } + /** + * tests Day input and its functions. + */ @Test public void testDay() { assertEquals(0, book.getDay()); @@ -46,6 +61,9 @@ public class BookingTest { assertNotEquals(0, book.getDay()); } + /** + * tests Month input and its functions. + */ @Test public void testMonth() { assertEquals(0, book.getMonth()); @@ -53,6 +71,9 @@ public class BookingTest { assertNotEquals(0, book.getMonth()); } + /** + * tests Year input and its functions. + */ @Test public void testYear() { assertEquals(2019, book.getYear()); @@ -60,6 +81,9 @@ public class BookingTest { assertNotEquals(2019, book.getYear()); } + /** + * tests ServiceProvider in booking class and its functions. + */ @Test public void testServiceprovider() { assertEquals(serviceprovider, book.getServiceprovider() ); @@ -68,6 +92,9 @@ public class BookingTest { assertNotEquals(serviceprovider, book.getServiceprovider()); } + /** + * tests HomeOwner in booking class and its functions. + */ @Test public void testHomeowner() { assertEquals(user, book.getHomeowner() ); @@ -76,6 +103,9 @@ public class BookingTest { assertNotEquals(user, book.getHomeowner()); } + /** + * tests Service in booking class and its functions. + */ @Test public void testService() { assertEquals(service, book.getService() ); @@ -84,12 +114,18 @@ public class BookingTest { assertNotEquals(service, book.getService()); } + /** + * tests Status and its functions by setting it up. + */ @Test public void testStatus() { book.setStatus(Booking.Status.CONFIRMED); assertEquals(Booking.Status.CONFIRMED, book.getStatus()); } + /** + * tests Rating and its functions by setting it up. + */ @Test public void testRating() { book.setRating(5);