Skip to content

Commit

Permalink
OCBC code challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
khalid64927 committed Jun 3, 2022
1 parent a008cfc commit 13eb1ee
Show file tree
Hide file tree
Showing 152 changed files with 6,128 additions and 2,855 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/build
/captures
.externalNativeBuild
.cxx
.DG_Store
/.DS_Store
/buildSrc/build/
1 change: 1 addition & 0 deletions GitHubRepos/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
.externalNativeBuild
.cxx
.DG_Store
/.DS_Store
/buildSrc/build/
/.idea/shelf/
Binary file added GitHubRepos/.idea/.DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion GitHubRepos/.idea/compiler.xml

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

4 changes: 3 additions & 1 deletion GitHubRepos/.idea/gradle.xml

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

5 changes: 5 additions & 0 deletions GitHubRepos/.idea/jarRepositories.xml

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

10 changes: 8 additions & 2 deletions GitHubRepos/.idea/misc.xml

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

56 changes: 26 additions & 30 deletions GitHubRepos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,50 +11,46 @@


### Functionality
App shows has coding assignment for OCBC
Has below features
1. Login
2. Register user
3. Show balance
4. Show transactions
5. Make transfer
6. Logout

App shows list of github repos with Local DB as single source of truth.

Swipe to refresh will update the list

#### RepoFragment
This fragment displays the list of a repository
This has Clean code architecture and has below layers
1. Repository layer: provides mock and remote interfaces
2. ViewModel Layer: business layer
3. View Layer: Android View layer


#### Building
##[The project uses Gradle KTS script]
## The project is in Kotlin

## APK can be found in [release/apks]
## Screenshots can be found in [release/apks]

Run below command to build and install
`./gradlew app:installProdDebug`

## Quality
1. This project is formatted with Spotless can be added in commit/push hooks
to maintain clean code review process
2. Has Lint baseline static check which can be added in CICD
3. Has Jacoco for code coverage config which can be added in CICD
4. Has checkstyle config static check which can be added in CICD

### Testing
The project uses both instrumentation tests that run on the device
and local unit tests that run on your computer.
To run both of them and generate a coverage report, you can run:
## APK can be found in [release]
## Screenshots can be found in [release]

# Demo Finish
![alt text](release/Screenshot_20220215_222225.png)


#### Device Tests
##### UI Tests
The projects uses Espresso for UI testing. Since each fragment
is limited to a ViewModel, each test mocks related ViewModel to
run the tests.
##### Database Tests
The project creates an in memory database for each database test but still
runs them on the device.
![alt text](release/Screenshot 2022-02-15 at 10.43.19 PM.png)

#### Local Unit Tests
##### ViewModel Tests
Each ViewModel is tested using local unit tests with mock Repository
implementations.
##### Repository Tests
Each Repository is tested using local unit tests with mock web service and
mock database.
##### Webservice Tests
The project uses [MockWebServer][mockwebserver] and Fake implementations

![alt text](release/Screenshot 2022-02-15 at 10.43.37 PM.png)
## Jacoco
run "jacocoPRODDEBUGReport"

Expand Down
Binary file modified GitHubRepos/app/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions GitHubRepos/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ dependencies {
implementation(Dependencies.CRASH)
implementation(Dependencies.CR_CORE)
implementation(Dependencies.CR_ANDROID)
implementation("com.dynatrace.agent:agent-android:8.231.2.1007")

implementation(Dependencies.DAGGER_RUNTIME)
api(Dependencies.DAGGER_ANDROID)
Expand Down Expand Up @@ -113,6 +114,7 @@ dependencies {
kapt(Dependencies.GLIDE_COMPILER)
// Nav
implementation(Dependencies.NAV_RUNTIME_FRAGMENT_KTX)
debugImplementation(Dependencies.CHUCKER)
}

pln("script end")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
/*
* Copyright 2020 Mohammed Khalid Hamid.
* MIT License
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Copyright 2021 Mohammed Khalid Hamid.
*
* http://www.apache.org/licenses/LICENSE-2.0
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.khalid.hamid.githubrepos
Expand Down

This file was deleted.

Loading

0 comments on commit 13eb1ee

Please sign in to comment.