Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
project-Lab7
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amirhosein Rajabpour
project-Lab7
Commits
b54cfadd
Commit
b54cfadd
authored
May 03, 2019
by
Amirhosein Rajabpour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final commit (tests added)
parent
70bf88cf
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
123 additions
and
0 deletions
+123
-0
AirplaneTest.java
src/test/AirplaneTest.java
+27
-0
FlightTest.java
src/test/FlightTest.java
+46
-0
TicketTest.java
src/test/TicketTest.java
+50
-0
No files found.
src/test/AirplaneTest.java
0 → 100644
View file @
b54cfadd
package
test
;
import
com.TicketManagement.Airplane
;
import
com.TicketManagement.Seat
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
AirplaneTest
{
static
Airplane
airplane
;
static
Seat
seat
;
@BeforeAll
public
static
void
creatairplane
(){
seat
=
new
Seat
(
1
,
"firstClass"
);
airplane
=
new
Airplane
(
seat
,
"iranAir"
,
"707"
);
}
@Test
public
void
testModel
(){
assertEquals
(
"707"
,
airplane
.
getModel
());
}
@Test
public
void
testAirPlaneAgency
(){
assertEquals
(
"iranAir"
,
airplane
.
getAirplaneagency
());
}
}
src/test/FlightTest.java
0 → 100644
View file @
b54cfadd
package
test
;
import
com.TicketManagement.Airplane
;
import
com.TicketManagement.Flight
;
import
com.TicketManagement.Seat
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.Test
;
import
java.util.Date
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
FlightTest
{
static
Flight
flight
;
static
Date
date
;
static
Airplane
airplane
;
static
Seat
seat
;
@BeforeAll
public
static
void
creatflight
()
{
seat
=
new
Seat
(
1
,
"firstClass"
);
airplane
=
new
Airplane
(
seat
,
"iranAir"
,
"707"
);
flight
=
new
Flight
(
date
,
1
,
"mashhad"
,
"tehran"
,
airplane
);
}
@Test
public
void
testdestenation
()
{
assertEquals
(
"mashhad"
,
flight
.
getDestination
());
}
@Test
public
void
teststart
()
{
assertEquals
(
"tehran"
,
flight
.
getSource
());
}
@Test
public
void
testAirplane
()
{
assertEquals
(
airplane
.
getModel
(),
flight
.
getModel
());
}
@Test
public
void
testDate
()
{
assertEquals
(
date
,
flight
.
getDate
());
}
}
\ No newline at end of file
src/test/TicketTest.java
0 → 100644
View file @
b54cfadd
package
test
;
import
com.TicketManagement.Airplane
;
import
com.TicketManagement.Flight
;
import
com.TicketManagement.Seat
;
import
com.TicketManagement.Ticket
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.Test
;
import
java.util.Date
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
TicketTest
{
static
Seat
seat
;
static
Flight
flight
;
static
Ticket
ticket
;
static
Date
date
;
static
Airplane
airplane
;
@BeforeAll
public
static
void
createticket
()
{
seat
=
new
Seat
(
1
,
"firstClass"
);
airplane
=
new
Airplane
(
seat
,
"iranAir"
,
"707"
);
flight
=
new
Flight
(
date
,
1
,
"tehran"
,
"mashad"
,
airplane
);
ticket
=
new
Ticket
(
seat
,
flight
,
10
,
"kabab"
);
}
@Test
public
void
testTcketgetseatnumber
()
{
assertEquals
(
1
,
ticket
.
getSeatnumber
());
}
@Test
public
void
testTicketgetflightnumber
()
{
assertEquals
(
1
,
ticket
.
getFlightnumber
());
}
@Test
public
void
testticketgetcargo
()
{
assertEquals
(
10
,
ticket
.
getLuggageWeight
());
}
@Test
public
void
testTicketgetmeal
()
{
assertEquals
(
"kabab"
,
ticket
.
getFood
());
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment