Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SQA Project Part1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ahmad Arslan
SQA Project Part1
Commits
4b1b7788
Commit
4b1b7788
authored
2 years ago
by
Sara Prifti
Browse files
Options
Downloads
Patches
Plain Diff
different cases for buyTickets Tests Work!
parent
5142d563
Branches
Ying
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/rwth/swc/sqa/DataService.java
+10
-0
10 additions, 0 deletions
src/main/java/de/rwth/swc/sqa/DataService.java
src/test/java/de/rwth/swc/sqa/TicketTest.java
+1
-1
1 addition, 1 deletion
src/test/java/de/rwth/swc/sqa/TicketTest.java
with
11 additions
and
1 deletion
src/main/java/de/rwth/swc/sqa/DataService.java
+
10
−
0
View file @
4b1b7788
...
...
@@ -74,6 +74,16 @@ public class DataService {
return
isValid
;
}
public
static
boolean
discountCanBeAppliedOnTheTicket
(
Ticket
ticket
){
boolean
applyDiscount
=
false
;
if
(
ticket
.
getValidFor
().
getValue
().
equals
(
"30d"
)
||
ticket
.
getValidFor
().
getValue
().
equals
(
"1y"
)){
if
(
ticket
.
getDiscountCard
()==
true
){
applyDiscount
=
true
;
}
}
return
applyDiscount
;
}
//check if the discountCard can be applied for the requested ticket
public
static
boolean
discountCanBeApplied
(
DiscountCard
discountCard
,
TicketValidationRequest
ticketValidationRequest
){
boolean
applyDiscount
=
false
;
...
...
This diff is collapsed.
Click to expand it.
src/test/java/de/rwth/swc/sqa/TicketTest.java
+
1
−
1
View file @
4b1b7788
...
...
@@ -50,7 +50,7 @@ public class TicketTest {
parms1
.
put
(
"validFor"
,
"1d"
);
parms1
.
put
(
"zone"
,
"A"
);
parms1
.
put
(
"student"
,
false
);
parms1
.
put
(
"discountCard"
,
tru
e
);
parms1
.
put
(
"discountCard"
,
fals
e
);
parms1
.
put
(
"disabled"
,
true
);
parms1
.
put
(
"validFrom"
,
"2022-05-20 10:00:00"
);
RestAssured
.
given
().
header
(
"content-Type"
,
"application/json"
).
and
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment