diff --git a/OlympusServices/.idea/caches/build_file_checksums.ser b/OlympusServices/.idea/caches/build_file_checksums.ser index 66d481e..a72ac4f 100644 Binary files a/OlympusServices/.idea/caches/build_file_checksums.ser and b/OlympusServices/.idea/caches/build_file_checksums.ser differ 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); diff --git a/README.md b/README.md index 9e78c1f..03d54a1 100644 --- a/README.md +++ b/README.md @@ -15,5 +15,5 @@ password = testing APK tested on a Sony Xperia XA2, model H3123 Build Status -[![CircleCI](https://circleci.com/gh/ebivibe/SEG2105-Olympus/tree/master.svg?style=svg&circle-token=01dbbc3800d7ee80871796675582a67ba7c83604)](https://circleci.com/gh/ebivibe/SEG2105-Olympus/tree/master) +[![CircleCI](https://circleci.com/gh/ebivibe/SEG2105-Olympus/tree/deliverable3.svg?style=svg&circle-token=01dbbc3800d7ee80871796675582a67ba7c83604)](https://circleci.com/gh/ebivibe/SEG2105-Olympus/tree/deliverable3)