Repository navigation
first Commit #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JoaquinGonzales
wants to merge
18
commits into
SeleniumCourse:develop
Choose a base branch
from
JoaquinGonzales:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
first Commit #12
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
755fe89
first Commit
JoaquinGonzales 3a1013b
test
JoaquinGonzales e197770
test
JoaquinGonzales a1714c1
test
JoaquinGonzales da9a5de
test commit
JoaquinGonzales 03fb6c4
Adding Shape and movies classes
daniel-jauregui e83b4e0
Update Comments
daniel-jauregui 477d417
Update Package name
daniel-jauregui 7a0b0e5
Updating toolversion for checkstyle, PMD and findbugs on build.gradle
carledriss c3e8a1d
Update files according best practice suggested by gradle. first part.
daniel-jauregui a2c20fd
CodeReview last part
daniel-jauregui 025a678
Remove public redundant according with travis
daniel-jauregui cb608cd
Updating toolversion for checkstyle and PMD
carledriss 4417704
Selenium with salesforce
JoaquinGonzales 15b9df1
Selenium with SESALESFORCE
JoaquinGonzales 5a9f2db
Selenium with SESALESFORCE-2
JoaquinGonzales cb3f1b4
Selenium with SESALESFORCE-3
JoaquinGonzales 2db0094
including PageFactory
JoaquinGonzales File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update files according best practice suggested by gradle. first part.
- Loading branch information
commit c3e8a1ddbc8f4015a6b10368504f1b1181dcda56
There are no files selected for viewing
34 changes: 24 additions & 10 deletions
34
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/Children.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,34 @@ | ||
| package com.jalasoft.selenium.daniel.jauregui.movies; | ||
|
|
||
| /** | ||
| * Class Children | ||
| * Class Children. | ||
| */ | ||
| public class Children extends aMovie { | ||
|
|
||
| public Children(String _title,int bonus) { | ||
| super(_title, bonus); | ||
| public class Children extends MovieAbs { | ||
| private final int restOfRentedDays = 3; | ||
| private final double multiplyOfRentedDays = 1.5; | ||
| /** | ||
| * Constructor of Children. | ||
| * @param title will contain the name of Movie. | ||
| * @param bonus will give to the movie a bonus. | ||
| */ | ||
| public Children(final String title, final int bonus) { | ||
| super(title, bonus); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @param rentedDays: number of day where movie was rented. | ||
| * @return | ||
| */ | ||
| @Override | ||
| public double calculateRate(int rentedDays, double thisAmount) { | ||
| if (rentedDays <= 0) { return 0; } | ||
| thisAmount += 1.5; | ||
| if (rentedDays > 3) | ||
| thisAmount += (rentedDays - 3) * 1.5; | ||
| public double calculateRate(final int rentedDays) { | ||
| if (rentedDays <= 0) { | ||
| return 0; | ||
| } | ||
| double thisAmount = multiplyOfRentedDays; | ||
| if (rentedDays > restOfRentedDays) { | ||
| thisAmount += (rentedDays - restOfRentedDays) * multiplyOfRentedDays; | ||
| } | ||
| return thisAmount; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 18 additions & 4 deletions
22
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/Main.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,24 @@ | ||
| package com.jalasoft.selenium.daniel.jauregui.movies; | ||
|
|
||
| public class Main { | ||
| public static void main(String[] args) { | ||
| /** | ||
| * Movies Class. | ||
| * @author Daniel Jauregui | ||
| */ | ||
| class Movies { | ||
| /** | ||
| * Constructor. | ||
| */ | ||
| public void movies() { | ||
| // Nothing to do | ||
| } | ||
| /** | ||
| * Initial method of application. | ||
| * @param args : Initial Arguments. | ||
| */ | ||
| public static void main(final String[] args) { | ||
| Customer customer = new Customer("Test"); | ||
| customer.addRental(new Rental(new NewRelease("The Revenant",1), 2)); | ||
| customer.addRental(new Rental(new Regular("Terminator",0), 2)); | ||
| customer.addRental(new Rental(new NewRelease("The Revenant", 1), 2)); | ||
| customer.addRental(new Rental(new Regular("Terminator", 0), 2)); | ||
| System.out.println(customer.statement()); | ||
| } | ||
| } |
30 changes: 0 additions & 30 deletions
30
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/Movie.java
This file was deleted.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/MovieAbs.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| package com.jalasoft.selenium.daniel.jauregui.movies; | ||
|
|
||
| /** | ||
| * MovieAbs Abstract class. | ||
| * @author Daniel Jauregui | ||
| */ | ||
| abstract class MovieAbs implements MovieInt { | ||
| private String title; | ||
| private int bonus; | ||
|
|
||
| /** | ||
| * Constructor of Class. | ||
| * @param title will have the name of movie. | ||
| * @param bonus will have the value of bonus. | ||
| */ | ||
| public MovieAbs(final String title, final int bonus) { | ||
| this.title = title; | ||
| this.bonus = bonus; | ||
| } | ||
|
|
||
| /** | ||
| * Get the Bonus of movie. | ||
| * @return the integer number of bonus. | ||
| */ | ||
| public int getBonus() { | ||
| return this.bonus; | ||
| } | ||
|
|
||
| /** | ||
| * Set a bonus for a movie. | ||
| * @param bonus the new bonus value. | ||
| */ | ||
| public void setBonus(final int bonus) { | ||
| this.bonus = bonus; | ||
| } | ||
|
|
||
| /** | ||
| * Get the title of movie. | ||
| * @return an String with the title of movie. | ||
| */ | ||
| public String getTitle() { | ||
| return this.title; | ||
| } | ||
|
|
||
| /** | ||
| * Set a new title of movie. | ||
| * @param title will get the new title for the movie. | ||
| */ | ||
| public void setTitle(final String title) { | ||
| this.title = title; | ||
| } | ||
|
|
||
| /** | ||
| * Calculate the bonus for frequent renter points. | ||
| * @param rentedDays get the rented days of movie. | ||
| * @return the bonus if it is major than 0. | ||
| */ | ||
| public int calculateBonus(final int rentedDays) { | ||
| if ((this.bonus != 0) && (rentedDays > 1)) { | ||
| return (this.bonus + 1); | ||
| } | ||
| return 1; | ||
| } | ||
| } |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/MovieInt.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.jalasoft.selenium.daniel.jauregui.movies; | ||
| /** | ||
| * Interface MovieInt. | ||
| * @author Daniel Jauregui | ||
| */ | ||
| interface MovieInt { | ||
| /** | ||
| * calculateRate of movie. | ||
| * @param rentedDays give a number of days movie was rented. | ||
| * @return calculated rate. | ||
| */ | ||
| double calculateRate(int rentedDays); | ||
| } |
31 changes: 22 additions & 9 deletions
31
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/NewRelease.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,29 @@ | ||
| package com.jalasoft.selenium.daniel.jauregui.movies; | ||
|
|
||
| public class NewRelease extends aMovie { | ||
|
|
||
| public NewRelease(String _title, int bonus) { | ||
| super(_title, bonus); | ||
| /** | ||
| * Class NewRelease. | ||
| */ | ||
| public class NewRelease extends MovieAbs { | ||
| private final int restOfRentedDays = 3; | ||
| /** | ||
| * Constructor of Children. | ||
| * @param title will contain the name of Movie. | ||
| * @param bonus will give to the movie a bonus. | ||
| */ | ||
| public NewRelease(final String title, final int bonus) { | ||
| super(title, bonus); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @param rentedDays: number of day where movie was rented. | ||
| * @return | ||
| */ | ||
| @Override | ||
| public double calculateRate(int rentedDays, double thisAmount) { | ||
| if (rentedDays <= 0) { return 0; } | ||
| thisAmount += rentedDays * 3; | ||
| return thisAmount; | ||
| public double calculateRate(final int rentedDays) { | ||
| if (rentedDays <= 0) { | ||
| return 0; | ||
| } | ||
| return (double) (rentedDays * restOfRentedDays); | ||
| } | ||
|
|
||
| } |
35 changes: 26 additions & 9 deletions
35
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/Regular.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,34 @@ | ||
| package com.jalasoft.selenium.daniel.jauregui.movies; | ||
|
|
||
| public class Regular extends aMovie { | ||
|
|
||
| public Regular(String _title, int bonus) { | ||
| super(_title,bonus); | ||
| /** | ||
| * Class NewRelease. | ||
| */ | ||
| public class Regular extends MovieAbs { | ||
| private final int restOfRentedDays = 2; | ||
| private final double multiplyOfRentedDays = 1.5; | ||
| /** | ||
| * Constructor of Children. | ||
| * @param title will contain the name of Movie. | ||
| * @param bonus will give to the movie a bonus. | ||
| */ | ||
| public Regular(final String title, final int bonus) { | ||
| super(title, bonus); | ||
| } | ||
|
|
||
| /** | ||
| * | ||
| * @param rentedDays: number of day where movie was rented. | ||
| * @return | ||
| */ | ||
| @Override | ||
| public double calculateRate(int rentedDays, double thisAmount) { | ||
| if (rentedDays <= 0) { return 0; } | ||
| thisAmount += 2; | ||
| if (rentedDays > 2) | ||
| thisAmount += (rentedDays - 2) * 1.5; | ||
| public double calculateRate(final int rentedDays) { | ||
| if (rentedDays <= 0) { | ||
| return 0; | ||
| } | ||
| double thisAmount = restOfRentedDays; | ||
| if (rentedDays > restOfRentedDays) { | ||
| thisAmount += (rentedDays - restOfRentedDays) * multiplyOfRentedDays; | ||
| } | ||
| return thisAmount; | ||
| } | ||
| } |
36 changes: 26 additions & 10 deletions
36
src/main/java/com/jalasoft/selenium/daniel/jauregui/movies/Rental.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,19 +1,35 @@ | ||
| package com.jalasoft.selenium.daniel.jauregui.movies; | ||
|
|
||
| /** | ||
| * Rental Class. | ||
| * @author Daniel Jauregui | ||
| */ | ||
| class Rental { | ||
| private final aMovie _movie; | ||
| private final int _daysRented; | ||
|
|
||
| public Rental(aMovie movie, int daysRented) { | ||
| _movie = movie; | ||
| _daysRented = daysRented; | ||
| private final MovieAbs movie; | ||
| private final int daysRented; | ||
| /** | ||
| * Constructor of Class. | ||
| * @param movie : Object of Abstract Class MovieAbs. | ||
| * @param daysRented : Days of movie was rented. | ||
| */ | ||
| public Rental(final MovieAbs movie, final int daysRented) { | ||
| this.movie = movie; | ||
| this.daysRented = daysRented; | ||
| } | ||
|
|
||
| /** | ||
| * Get the rented days of the movie rented. | ||
| * @return integer name as day. | ||
| */ | ||
| public int getDaysRented() { | ||
| return _daysRented; | ||
| return this.daysRented; | ||
| } | ||
|
|
||
| public aMovie getMovie() { | ||
| return _movie; | ||
| /** | ||
| * Get the object movie. | ||
| * @return an object of movie associated to this class. | ||
| */ | ||
| public MovieAbs getMovie() { | ||
| return this.movie; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is doing 3 things
please split it.