From f23d478492a6f328845c29e340c676ebb773d051 Mon Sep 17 00:00:00 2001 From: shrpate <44587575+shrpate@users.noreply.github.com> Date: Tue, 10 Mar 2020 17:28:40 -0600 Subject: [PATCH 1/4] Update .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e52c153e..d602da97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ before_install: # Get gradle - chmod +x gradlew - - wget http://services.gradle.org/distributions/gradle-5.3-bin.zip + - wget https://services.gradle.org/distributions/gradle-5.3-bin.zip - unzip -qq gradle-5.3-bin.zip - export GRADLE_HOME=$PWD/gradle-5.3 - export PATH=$GRADLE_HOME/bin:$PATH From 120c78c6245b54dd48cc5e31b2eb9eff475d2664 Mon Sep 17 00:00:00 2001 From: shrpate <44587575+shrpate@users.noreply.github.com> Date: Tue, 10 Mar 2020 17:37:48 -0600 Subject: [PATCH 2/4] Create .gitignore --- .gitignore | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..56cc6425 --- /dev/null +++ b/.gitignore @@ -0,0 +1,85 @@ +# Built application files +*.apk +*.aar +*.ap_ +*.aab + +# Files for the ART/Dalvik VM +*.dex + +# Java class files +*.class + +# Generated files +bin/ +gen/ +out/ +# Uncomment the following line in case you need and you don't have the release build type files in your app +# release/ + +# Gradle files +.gradle/ +build/ + +# Local configuration file (sdk path, etc) +local.properties + +# Proguard folder generated by Eclipse +proguard/ + +# Log Files +*.log + +# Android Studio Navigation editor temp files +.navigation/ + +# Android Studio captures folder +captures/ + +# IntelliJ +*.iml +.idea/workspace.xml +.idea/tasks.xml +.idea/gradle.xml +.idea/assetWizardSettings.xml +.idea/dictionaries +.idea/libraries +# Android Studio 3 in .gitignore file. +.idea/caches +.idea/modules.xml +# Comment next line if keeping position of elements in Navigation Editor is relevant for you +.idea/navEditor.xml + +# Keystore files +# Uncomment the following lines if you do not want to check your keystore files in. +#*.jks +#*.keystore + +# External native build folder generated in Android Studio 2.2 and later +.externalNativeBuild +.cxx/ + +# Google Services (e.g. APIs or Firebase) +# google-services.json + +# Freeline +freeline.py +freeline/ +freeline_project_description.json + +# fastlane +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots +fastlane/test_output +fastlane/readme.md + +# Version control +vcs.xml + +# lint +lint/intermediates/ +lint/generated/ +lint/outputs/ +lint/tmp/ +# lint/reports/ From 743922e80b9525420b6db500400450e39cb3b252 Mon Sep 17 00:00:00 2001 From: Shridhar Patel Date: Fri, 13 Mar 2020 12:24:33 -0600 Subject: [PATCH 3/4] New Test --- .idea/codeStyles/Project.xml | 116 ++++++++++++++++++ .idea/misc.xml | 25 ++++ .idea/runConfigurations.xml | 12 ++ .../simpleparadox/listycity/CityListTest.java | 7 ++ 4 files changed, 160 insertions(+) create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/runConfigurations.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 00000000..681f41ae --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..91595407 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + 1.8 + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 00000000..7f68460d --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java b/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java index 787eab7e..61ba05e4 100644 --- a/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java +++ b/app/src/test/java/com/example/simpleparadox/listycity/CityListTest.java @@ -93,4 +93,11 @@ void testCountCities() { assertEquals(1, cityList.countCities()); } + + @Test + void testisCity() { + CityList cityList = mockCityList(); + + assertTrue(cityList.isCity(mockCity())); + } } \ No newline at end of file From 1d7d4bd1f5cb4cbd3bb1d87b0dcb895ac4972a2d Mon Sep 17 00:00:00 2001 From: Shridhar Patel Date: Fri, 13 Mar 2020 12:30:53 -0600 Subject: [PATCH 4/4] New Test --- .../simpleparadox/listycity/CityList.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/src/main/java/com/example/simpleparadox/listycity/CityList.java b/app/src/main/java/com/example/simpleparadox/listycity/CityList.java index 6da242f3..3e4d350c 100644 --- a/app/src/main/java/com/example/simpleparadox/listycity/CityList.java +++ b/app/src/main/java/com/example/simpleparadox/listycity/CityList.java @@ -77,4 +77,22 @@ public void delete(City city) { public int countCities() { return cities.size(); } + + /** + * This method checks to see if a city already exists in the list + * @param city + * City to check + * @return + * Return true if the city exists already + */ + public boolean isCity(City city) { + for (City c : cities) { + if (c.getCityName().equals(city.getCityName()) && + c.getProvinceName().equals(city.getProvinceName())) { + return true; + } + } + + return false; + } }