Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Jan Novák
eShop
Commits
e62cf698
Commit
e62cf698
authored
Oct 24, 2018
by
Karel Frajták
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restart
parent
1a23f7e3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
82 deletions
+9
-82
pom.xml
pom.xml
+6
-3
src/test/java/LoyaltyPointsTest.java
src/test/java/LoyaltyPointsTest.java
+3
-1
src/test/java/OrderTest.java
src/test/java/OrderTest.java
+0
-52
src/test/java/PurchasesArchiveTest.java
src/test/java/PurchasesArchiveTest.java
+0
-26
No files found.
pom.xml
View file @
e62cf698
...
...
@@ -6,12 +6,15 @@
<version>
1.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
org.assertj
</groupId>
<artifactId>
assertj-core
</artifactId>
<version>
3.10.0
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
<type>
jar
</type>
</dependency>
</dependencies>
<properties>
...
...
@@ -56,7 +59,7 @@
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-surefire-plugin
</artifactId>
...
...
src/test/java/LoyaltyPointsTest.java
View file @
e62cf698
...
...
@@ -6,6 +6,7 @@ import cz.cvut.eshop.shop.StandardItem;
import
java.util.Date
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.*;
public
class
LoyaltyPointsTest
{
...
...
@@ -24,7 +25,8 @@ public class LoyaltyPointsTest {
order
.
setCustomer
(
customer
);
order
.
create
();
// assert
assertEquals
(
10
,
customer
.
getLoyaltyPoints
());
//assertEquals(10, customer.getLoyaltyPoints());
assertThat
(
customer
.
getLoyaltyPoints
()).
isEqualTo
(
10
);
}
// For certain number of loyalty points the customer gets a discount for one
...
...
src/test/java/OrderTest.java
deleted
100644 → 0
View file @
1a23f7e3
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import
cz.cvut.eshop.shop.Order
;
import
cz.cvut.eshop.shop.ShoppingCart
;
import
cz.cvut.eshop.shop.StandardItem
;
import
org.junit.After
;
import
org.junit.AfterClass
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
*
* @author Karel
*/
public
class
OrderTest
{
@Test
public
void
createOrderWithCustomerNotSetTest
()
{
// setup
ShoppingCart
cart
=
new
ShoppingCart
();
Order
order
=
new
Order
(
cart
);
// act
order
.
create
();
// assert
}
@Test
public
void
orderStateIsUnchanged
()
{
// setup
ShoppingCart
cart
=
new
ShoppingCart
();
Order
order
=
new
Order
(
cart
,
10
);
// act
assertEquals
(
10
,
order
.
getState
());
}
@Test
public
void
itemsPassedCanBeRead
()
{
// setup
ShoppingCart
cart
=
new
ShoppingCart
();
cart
.
addItem
(
new
StandardItem
(
0
,
""
,
0
,
""
,
0
));
Order
order
=
new
Order
(
cart
,
0
);
// act
// assert
assertEquals
(
1
,
order
.
getItems
().
size
());
}
}
src/test/java/PurchasesArchiveTest.java
deleted
100644 → 0
View file @
1a23f7e3
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import
cz.cvut.eshop.archive.PurchasesArchive
;
import
org.junit.After
;
import
org.junit.AfterClass
;
import
org.junit.Before
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
/**
*
* @author Karel
*/
public
class
PurchasesArchiveTest
{
@Test
public
void
itemWasSoldOnce
()
{
PurchasesArchive
archive
=
new
PurchasesArchive
();
assertNotNull
(
archive
);
}
}
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