Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
061a978f6c | |||
cfdab3230d | |||
dcbb133489 | |||
891504ef09 |
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
.idea/compiler.xml
|
8
.idea/.gitignore
generated
vendored
Normal file
8
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/../../../../../../../../../:\Users\georg\OneDrive\FH\SWE\Monster Card Trading Game\code\.idea/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
1
.idea/.name
generated
Normal file
1
.idea/.name
generated
Normal file
@ -0,0 +1 @@
|
|||||||
|
MTCG
|
13
.idea/compiler.xml
generated
Normal file
13
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile name="Maven default annotation processors profile" enabled="true">
|
||||||
|
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||||
|
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||||
|
<outputRelativeToContentRoot value="true" />
|
||||||
|
<module name="MTCG" />
|
||||||
|
</profile>
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
20
.idea/jarRepositories.xml
generated
Normal file
20
.idea/jarRepositories.xml
generated
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="RemoteRepositoriesConfiguration">
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Central Repository" />
|
||||||
|
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="central" />
|
||||||
|
<option name="name" value="Maven Central repository" />
|
||||||
|
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||||
|
</remote-repository>
|
||||||
|
<remote-repository>
|
||||||
|
<option name="id" value="jboss.community" />
|
||||||
|
<option name="name" value="JBoss Community repository" />
|
||||||
|
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||||
|
</remote-repository>
|
||||||
|
</component>
|
||||||
|
</project>
|
14
.idea/misc.xml
generated
Normal file
14
.idea/misc.xml
generated
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="MavenProjectsManager">
|
||||||
|
<option name="originalFiles">
|
||||||
|
<list>
|
||||||
|
<option value="$PROJECT_DIR$/pom.xml" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_14" default="false" project-jdk-name="15" project-jdk-type="JavaSDK">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
124
.idea/uiDesigner.xml
generated
Normal file
124
.idea/uiDesigner.xml
generated
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Palette2">
|
||||||
|
<group name="Swing">
|
||||||
|
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Button" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="RadioButton" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="CheckBox" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||||
|
<initial-values>
|
||||||
|
<property name="text" value="Label" />
|
||||||
|
</initial-values>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||||
|
<preferred-size width="150" height="-1" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||||
|
<preferred-size width="150" height="50" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||||
|
<preferred-size width="200" height="200" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||||
|
<preferred-size width="-1" height="20" />
|
||||||
|
</default-constraints>
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||||
|
</item>
|
||||||
|
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||||
|
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||||
|
</item>
|
||||||
|
</group>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
2
MTCG.iml
Normal file
2
MTCG.iml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4" />
|
30
pom.xml
Normal file
30
pom.xml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>at.reisinger.mtcg</groupId>
|
||||||
|
<artifactId>MTCG</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter</artifactId>
|
||||||
|
<version>RELEASE</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mockito</groupId>
|
||||||
|
<artifactId>mockito-core</artifactId>
|
||||||
|
<version>3.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mockito</groupId>
|
||||||
|
<artifactId>mockito-junit-jupiter</artifactId>
|
||||||
|
<version>3.5.13</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
</project>
|
2
src/main/java/Battle.java
Normal file
2
src/main/java/Battle.java
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
public class Battle {
|
||||||
|
}
|
37
src/main/java/Card.java
Normal file
37
src/main/java/Card.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
public class Card {
|
||||||
|
public Card(String name, double damage, ElementTyp elementTyp, CardType cardType) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDamage() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ElementTyp getElementTyp() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CardType getCardType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EffectivnessType getEffectivenessAgainst() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean setName(String neuerName) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean setDamage(int damage) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean setElementType(ElementTyp elementTyp) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
3
src/main/java/CardType.java
Normal file
3
src/main/java/CardType.java
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
public enum CardType {
|
||||||
|
MONSTER, SPELL
|
||||||
|
}
|
23
src/main/java/Cards.java
Normal file
23
src/main/java/Cards.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class Cards {
|
||||||
|
public Cards(ArrayList<Card> cardsArrayList) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cards() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCard(Card newCard) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<Card> getCards() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean delCard(Card delCard) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
21
src/main/java/Coins.java
Normal file
21
src/main/java/Coins.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
public class Coins {
|
||||||
|
public Coins(int coins) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCoinAmount() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addCoin(int coins) throws NegativAmountException{
|
||||||
|
throw new NegativAmountException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean removeCoin(int coins) throws NegativAmountException{
|
||||||
|
throw new NegativAmountException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean changeCoinAmmount(int coins) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
2
src/main/java/Credentials.java
Normal file
2
src/main/java/Credentials.java
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
public class Credentials {
|
||||||
|
}
|
2
src/main/java/DBConnection.java
Normal file
2
src/main/java/DBConnection.java
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
public class DBConnection {
|
||||||
|
}
|
5
src/main/java/EffectivnessType.java
Normal file
5
src/main/java/EffectivnessType.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
public enum EffectivnessType {
|
||||||
|
EFFEKTIVE,
|
||||||
|
NOTEFFEKTIVE,
|
||||||
|
NOEFFEKT
|
||||||
|
}
|
3
src/main/java/ElementTyp.java
Normal file
3
src/main/java/ElementTyp.java
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
public enum ElementTyp {
|
||||||
|
WATER, FIRE
|
||||||
|
}
|
5
src/main/java/MonsterCard.java
Normal file
5
src/main/java/MonsterCard.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
public class MonsterCard extends Card{
|
||||||
|
public MonsterCard(String name, double damage, ElementTyp elementTyp, CardType cardType) {
|
||||||
|
super(name, damage, elementTyp, cardType);
|
||||||
|
}
|
||||||
|
}
|
2
src/main/java/NegativAmountException.java
Normal file
2
src/main/java/NegativAmountException.java
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
public class NegativAmountException extends Exception {
|
||||||
|
}
|
17
src/main/java/Package.java
Normal file
17
src/main/java/Package.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
public class Package extends Cards{
|
||||||
|
public Package(Cards stack, Cards deck, String name, int price) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPrice() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String neuName) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
5
src/main/java/SpellCard.java
Normal file
5
src/main/java/SpellCard.java
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
public class SpellCard extends Card{
|
||||||
|
public SpellCard(String name, double damage, ElementTyp elementTyp, CardType cardType) {
|
||||||
|
super(name, damage, elementTyp, cardType);
|
||||||
|
}
|
||||||
|
}
|
17
src/main/java/Stack.java
Normal file
17
src/main/java/Stack.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
public class Stack extends Cards{
|
||||||
|
public Stack(Cards cards, Cards nochNewCards) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDeck(Cards newCards) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cards getDeck() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean delDeck(Cards delCards) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
15
src/main/java/Store.java
Normal file
15
src/main/java/Store.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public interface Store {
|
||||||
|
DBConnection db = new DBConnection();
|
||||||
|
|
||||||
|
void addTradingDeal(TradingDeal tradingDeal);
|
||||||
|
|
||||||
|
ArrayList<TradingDeal> getTradingDeals();
|
||||||
|
|
||||||
|
boolean doTrading(TradingDeal tradingDeal1, TradingDeal tradingDeal2);
|
||||||
|
|
||||||
|
ArrayList<TradingDeal> getPossibleTradingDeals();
|
||||||
|
|
||||||
|
ArrayList<TradingDeal> getPossibleAvailableTradingDeals();
|
||||||
|
}
|
43
src/main/java/TradingDeal.java
Normal file
43
src/main/java/TradingDeal.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
public class TradingDeal {
|
||||||
|
public TradingDeal(User user, Card cardToTrade, ElementTyp requiredElementType, double requiredMinDamage, CardType requiredCardType) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public User getTradingUser() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Card getCardToTrade() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ElementTyp getRequiredElementType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRequiredMinDamage() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CardType getRequiredCardType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTradingUser(User user) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCardToTrade(Card card) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequiredElementType(ElementTyp elementTyp) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequiredMinDamage(int damage) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequiredCardType(CardType cardType) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
55
src/main/java/User.java
Normal file
55
src/main/java/User.java
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class User implements Store{
|
||||||
|
public User(Credentials credentials, String name, String nachname, String email, Stack stack, Coins coins) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNachname() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String setName(String name) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String setNachname(String nachname) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String setEmail(String email) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cards buyPackage(Package mypackage) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addTradingDeal(TradingDeal tradingDeal) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<TradingDeal> getTradingDeals() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean doTrading(TradingDeal tradingDeal1, TradingDeal tradingDeal2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<TradingDeal> getPossibleTradingDeals() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<TradingDeal> getPossibleAvailableTradingDeals() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
53
src/test/java/CardTest.java
Normal file
53
src/test/java/CardTest.java
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
public class CardTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_getName() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
assertTrue(card.getName() != "");
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_getDamage() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
assertTrue(card.getDamage() >= 0);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_getElementType() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
ElementTyp elementTyp = card.getElementTyp();
|
||||||
|
assertTrue(elementTyp != null);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_getCardType() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
CardType cardType = card.getCardType();
|
||||||
|
assertTrue(cardType != null);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_getEffectivenessAgainst() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
EffectivnessType effectivnessType = card.getEffectivenessAgainst();
|
||||||
|
assertTrue(effectivnessType != null);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_setName() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
boolean result = card.setName("NeuerName");
|
||||||
|
assertTrue(result);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_setDamage() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
boolean result = card.setDamage(100);
|
||||||
|
assertTrue(result);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_setElementTyp() {
|
||||||
|
Card card = new Card("Name", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
boolean result = card.setElementType(ElementTyp.WATER);
|
||||||
|
assertTrue(result);
|
||||||
|
}
|
||||||
|
}
|
38
src/test/java/CardsTest.java
Normal file
38
src/test/java/CardsTest.java
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
public class CardsTest {
|
||||||
|
public Card newCard, card;
|
||||||
|
public Cards cards;
|
||||||
|
public ArrayList<Card> cardsArrayList;
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
|
||||||
|
newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
cardsArrayList = new ArrayList<Card>();
|
||||||
|
cardsArrayList.add(card);
|
||||||
|
cards = new Cards(cardsArrayList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test_addCard() {
|
||||||
|
ArrayList<Card> result = cards.getCards();
|
||||||
|
cards.addCard(newCard);
|
||||||
|
cardsArrayList.add(newCard);
|
||||||
|
assertTrue(result == cardsArrayList);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_delCard() {
|
||||||
|
boolean result = cards.delCard(newCard);
|
||||||
|
assertTrue(result);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getCards() {
|
||||||
|
ArrayList<Card> result = cards.getCards();
|
||||||
|
assertTrue(result == cardsArrayList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
58
src/test/java/CoinsTest.java
Normal file
58
src/test/java/CoinsTest.java
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
|
||||||
|
public class CoinsTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_getCoinAmount(){
|
||||||
|
Coins coin = new Coins(10);
|
||||||
|
assertTrue(coin.getCoinAmount() >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_addCoinException(){
|
||||||
|
try {
|
||||||
|
Coins coin = new Coins(10);
|
||||||
|
coin.addCoin(-10);
|
||||||
|
fail("Erwartet NegativAmountException - addCoin");
|
||||||
|
}catch (NegativAmountException negativAmountException) {
|
||||||
|
assertTrue(negativAmountException.getMessage()=="negativAmountException");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_removeCoinException(){
|
||||||
|
try {
|
||||||
|
Coins coin = new Coins(10);
|
||||||
|
coin.removeCoin(-10);
|
||||||
|
fail("Erwartet NegativAmountException - removeCoin");
|
||||||
|
}catch (NegativAmountException negativAmountException) {
|
||||||
|
assertTrue(negativAmountException.getMessage()=="negativAmountException");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_removeCoin(){
|
||||||
|
Coins coin = new Coins(10);
|
||||||
|
try {
|
||||||
|
assertTrue(coin.removeCoin(10));
|
||||||
|
} catch (NegativAmountException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_changeCoinAmount_true(){
|
||||||
|
Coins coin = new Coins(10);
|
||||||
|
assertTrue(coin.changeCoinAmmount(-10));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_changeCoinAmount_false(){
|
||||||
|
Coins coin = new Coins(9);
|
||||||
|
assertFalse(coin.changeCoinAmmount(-10));
|
||||||
|
}
|
||||||
|
}
|
47
src/test/java/PackageTest.java
Normal file
47
src/test/java/PackageTest.java
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
|
||||||
|
public class PackageTest {
|
||||||
|
private Cards newCards, cards, nochNewCards;
|
||||||
|
private Card newCard, card;
|
||||||
|
private ArrayList<Card> cardsArrayList, cardsArrayList2, cardsArrayList3;
|
||||||
|
private Package myPackage;
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
|
||||||
|
newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
cardsArrayList = new ArrayList<Card>();
|
||||||
|
cardsArrayList2 = new ArrayList<Card>();
|
||||||
|
cardsArrayList3 = new ArrayList<Card>();
|
||||||
|
cardsArrayList.add(card);
|
||||||
|
cardsArrayList2.add(newCard);
|
||||||
|
cards = new Cards(cardsArrayList);
|
||||||
|
newCards = new Cards(cardsArrayList2);
|
||||||
|
nochNewCards = new Cards(cardsArrayList3);
|
||||||
|
myPackage = new Package(cards, nochNewCards, "Name", 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test_getName() {
|
||||||
|
String result = myPackage.getName();
|
||||||
|
assertTrue(result=="Name");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test_getPrice() {
|
||||||
|
int result = myPackage.getPrice();
|
||||||
|
assertTrue(result==100);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test_setName() {
|
||||||
|
myPackage.setName("neuName");
|
||||||
|
String result = myPackage.getName();
|
||||||
|
assertTrue(result=="neuName");
|
||||||
|
}
|
||||||
|
}
|
18
src/test/java/SimpleCardTest.java
Normal file
18
src/test/java/SimpleCardTest.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import org.junit.jupiter.api.DisplayName;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static org.mockito.Mockito.mock;
|
||||||
|
|
||||||
|
public class SimpleCardTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@DisplayName("Test - getName()")
|
||||||
|
public void test_getName(){
|
||||||
|
//arrange
|
||||||
|
Card mockedA = mock(Card.class); //Erstellt einen Mock
|
||||||
|
String name = "Neuer Name";
|
||||||
|
//act
|
||||||
|
|
||||||
|
//assert
|
||||||
|
}
|
||||||
|
}
|
44
src/test/java/StackTest.java
Normal file
44
src/test/java/StackTest.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
|
||||||
|
public class StackTest {
|
||||||
|
private Cards newCards, cards, nochNewCards;
|
||||||
|
private Card newCard, card;
|
||||||
|
private ArrayList<Card> cardsArrayList, cardsArrayList2, cardsArrayList3;
|
||||||
|
private Stack stack;
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
|
||||||
|
newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
cardsArrayList = new ArrayList<Card>();
|
||||||
|
cardsArrayList2 = new ArrayList<Card>();
|
||||||
|
cardsArrayList3 = new ArrayList<Card>();
|
||||||
|
cardsArrayList.add(card);
|
||||||
|
cardsArrayList2.add(newCard);
|
||||||
|
cards = new Cards(cardsArrayList);
|
||||||
|
newCards = new Cards(cardsArrayList2);
|
||||||
|
nochNewCards = new Cards(cardsArrayList3);
|
||||||
|
stack = new Stack(cards, nochNewCards);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_addDeck() {
|
||||||
|
stack.addDeck(newCards);
|
||||||
|
Cards result = stack.getDeck();
|
||||||
|
assertTrue(result == newCards);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_delDeck() {
|
||||||
|
boolean result = stack.delDeck(cards);
|
||||||
|
assertTrue(result);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getDeck() {
|
||||||
|
Cards result = stack.getDeck();
|
||||||
|
assertTrue(result == cards);
|
||||||
|
}
|
||||||
|
}
|
82
src/test/java/StoreTest.java
Normal file
82
src/test/java/StoreTest.java
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
public class StoreTest {
|
||||||
|
|
||||||
|
private TradingDeal tradingDeal;
|
||||||
|
private Cards newCards, cards, nochNewCards;
|
||||||
|
private Card newCard, card;
|
||||||
|
private ArrayList<Card> cardsArrayList, cardsArrayList2, cardsArrayList3;
|
||||||
|
private Stack stack;
|
||||||
|
private User user, userNew;
|
||||||
|
private Store store;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
//Stack
|
||||||
|
card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
|
||||||
|
newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
cardsArrayList = new ArrayList<Card>();
|
||||||
|
cardsArrayList2 = new ArrayList<Card>();
|
||||||
|
cardsArrayList3 = new ArrayList<Card>();
|
||||||
|
cardsArrayList.add(card);
|
||||||
|
cardsArrayList2.add(newCard);
|
||||||
|
cards = new Cards(cardsArrayList);
|
||||||
|
newCards = new Cards(cardsArrayList2);
|
||||||
|
nochNewCards = new Cards(cardsArrayList3);
|
||||||
|
stack = new Stack(cards, nochNewCards);
|
||||||
|
|
||||||
|
//Coins
|
||||||
|
Coins coins = new Coins(10);
|
||||||
|
//User
|
||||||
|
Credentials credentials = new Credentials();
|
||||||
|
user = new User(credentials, "name", "nachname", "email", stack, coins);
|
||||||
|
userNew = new User(credentials, "nameNew", "nachnameNew", "emailNew", stack, coins);
|
||||||
|
|
||||||
|
//Trading Deal
|
||||||
|
Card cardToTrade = card;
|
||||||
|
ElementTyp requiredElementType = ElementTyp.FIRE;
|
||||||
|
double requiredMinDamage = 100;
|
||||||
|
CardType requiredCardType = CardType.MONSTER;
|
||||||
|
tradingDeal = new TradingDeal(user, cardToTrade, requiredElementType, requiredMinDamage, requiredCardType);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test_addTradingDeal() {
|
||||||
|
user.addTradingDeal(tradingDeal);
|
||||||
|
ArrayList<TradingDeal> expected = new ArrayList<TradingDeal>();
|
||||||
|
expected.add(tradingDeal);
|
||||||
|
assertTrue(user.getTradingDeals() == expected);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_doTrade() {
|
||||||
|
boolean result = user.doTrading(tradingDeal, tradingDeal);
|
||||||
|
assertTrue(result);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getTradingDeals() {
|
||||||
|
ArrayList<TradingDeal> result = user.getTradingDeals();
|
||||||
|
ArrayList<TradingDeal> expected = new ArrayList<TradingDeal>();
|
||||||
|
expected.add(tradingDeal);
|
||||||
|
assertTrue(result == expected);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getPossibleTradingDeals() {
|
||||||
|
ArrayList<TradingDeal> result = user.getPossibleTradingDeals();
|
||||||
|
ArrayList<TradingDeal> expected = new ArrayList<TradingDeal>();
|
||||||
|
expected.add(tradingDeal);
|
||||||
|
assertTrue(result == expected);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getAvailableTradingDeals() {
|
||||||
|
ArrayList<TradingDeal> result = user.getPossibleAvailableTradingDeals();
|
||||||
|
ArrayList<TradingDeal> expected = new ArrayList<TradingDeal>();
|
||||||
|
expected.add(tradingDeal);
|
||||||
|
assertTrue(result == expected);
|
||||||
|
}
|
||||||
|
}
|
104
src/test/java/TradingDealTest.java
Normal file
104
src/test/java/TradingDealTest.java
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
|
||||||
|
public class TradingDealTest {
|
||||||
|
|
||||||
|
private TradingDeal tradingDeal;
|
||||||
|
private Cards newCards, cards, nochNewCards;
|
||||||
|
private Card newCard, card;
|
||||||
|
private ArrayList<Card> cardsArrayList, cardsArrayList2, cardsArrayList3;
|
||||||
|
private Stack stack;
|
||||||
|
private User user, userNew;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
//Stack
|
||||||
|
card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
|
||||||
|
newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
cardsArrayList = new ArrayList<Card>();
|
||||||
|
cardsArrayList2 = new ArrayList<Card>();
|
||||||
|
cardsArrayList3 = new ArrayList<Card>();
|
||||||
|
cardsArrayList.add(card);
|
||||||
|
cardsArrayList2.add(newCard);
|
||||||
|
cards = new Cards(cardsArrayList);
|
||||||
|
newCards = new Cards(cardsArrayList2);
|
||||||
|
nochNewCards = new Cards(cardsArrayList3);
|
||||||
|
stack = new Stack(cards, nochNewCards);
|
||||||
|
|
||||||
|
//Coins
|
||||||
|
Coins coins = new Coins(10);
|
||||||
|
//User
|
||||||
|
Credentials credentials = new Credentials();
|
||||||
|
user = new User(credentials, "name", "nachname", "email", stack, coins);
|
||||||
|
userNew = new User(credentials, "nameNew", "nachnameNew", "emailNew", stack, coins);
|
||||||
|
|
||||||
|
//Trading Deal
|
||||||
|
Card cardToTrade = card;
|
||||||
|
ElementTyp requiredElementType = ElementTyp.FIRE;
|
||||||
|
double requiredMinDamage = 100;
|
||||||
|
CardType requiredCardType = CardType.MONSTER;
|
||||||
|
tradingDeal = new TradingDeal(user, cardToTrade, requiredElementType, requiredMinDamage, requiredCardType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test_getTradingUser() {
|
||||||
|
User result = tradingDeal.getTradingUser();
|
||||||
|
assertTrue(result==user);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getCardToTrade() {
|
||||||
|
Card result = tradingDeal.getCardToTrade();
|
||||||
|
assertTrue(result==card);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getRequiredElementType() {
|
||||||
|
ElementTyp result = tradingDeal.getRequiredElementType();
|
||||||
|
assertTrue(result==ElementTyp.FIRE);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getRequiredMinDamage() {
|
||||||
|
int result = tradingDeal.getRequiredMinDamage();
|
||||||
|
assertTrue(result==100);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_getRequiredCardType() {
|
||||||
|
CardType result = tradingDeal.getRequiredCardType();
|
||||||
|
assertTrue(result==CardType.MONSTER);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test_setTradingUser() {
|
||||||
|
tradingDeal.setTradingUser(userNew);
|
||||||
|
User result = tradingDeal.getTradingUser();
|
||||||
|
assertTrue(result==userNew);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_setCardToTrade() {
|
||||||
|
tradingDeal.setCardToTrade(newCard);
|
||||||
|
Card result = tradingDeal.getCardToTrade();
|
||||||
|
assertTrue(result==newCard);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_setRequiredElementType() {
|
||||||
|
tradingDeal.setRequiredElementType(ElementTyp.WATER);
|
||||||
|
ElementTyp result = tradingDeal.getRequiredElementType();
|
||||||
|
assertTrue(result==ElementTyp.WATER);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_setRequiredMinDamage() {
|
||||||
|
tradingDeal.setRequiredMinDamage(10);
|
||||||
|
int result = tradingDeal.getRequiredMinDamage();
|
||||||
|
assertTrue(result==10);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
void test_setRequiredCardType() {
|
||||||
|
tradingDeal.setRequiredCardType(CardType.SPELL);
|
||||||
|
CardType result = tradingDeal.getRequiredCardType();
|
||||||
|
assertTrue(result==CardType.SPELL);
|
||||||
|
}
|
||||||
|
}
|
80
src/test/java/UserTest.java
Normal file
80
src/test/java/UserTest.java
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
|
||||||
|
public class UserTest {
|
||||||
|
private TradingDeal tradingDeal;
|
||||||
|
private Cards newCards, cards, nochNewCards;
|
||||||
|
private Card newCard, card;
|
||||||
|
private ArrayList<Card> cardsArrayList, cardsArrayList2, cardsArrayList3;
|
||||||
|
private Stack stack;
|
||||||
|
private User user;
|
||||||
|
private Package myPackage;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void setUp() {
|
||||||
|
//Stack
|
||||||
|
card = new Card("Name", 10, ElementTyp.WATER, CardType.MONSTER);
|
||||||
|
newCard = new Card("NameNew", 10, ElementTyp.WATER, CardType.SPELL);
|
||||||
|
cardsArrayList = new ArrayList<Card>();
|
||||||
|
cardsArrayList2 = new ArrayList<Card>();
|
||||||
|
cardsArrayList3 = new ArrayList<Card>();
|
||||||
|
cardsArrayList.add(card);
|
||||||
|
cardsArrayList2.add(newCard);
|
||||||
|
cards = new Cards(cardsArrayList);
|
||||||
|
newCards = new Cards(cardsArrayList2);
|
||||||
|
nochNewCards = new Cards(cardsArrayList3);
|
||||||
|
stack = new Stack(cards, nochNewCards);
|
||||||
|
//Package
|
||||||
|
myPackage = new Package(cards, nochNewCards, "Name", 100);
|
||||||
|
|
||||||
|
//Coins
|
||||||
|
Coins coins = new Coins(10);
|
||||||
|
//User
|
||||||
|
Credentials credentials = new Credentials();
|
||||||
|
user = new User(credentials, "name", "nachname", "email", stack, coins);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_getName() {
|
||||||
|
String result = user.getName();
|
||||||
|
assertTrue(result != "");
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_getNachname() {
|
||||||
|
String result = user.getNachname();
|
||||||
|
assertTrue(result != "");
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_getEmail() {
|
||||||
|
String result = user.getEmail();
|
||||||
|
assertTrue(result != "");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test_setName() {
|
||||||
|
String newstring = "new";
|
||||||
|
String result = user.setName(newstring);
|
||||||
|
assertTrue(result != newstring);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_setNachname() {
|
||||||
|
String newstring = "new";
|
||||||
|
String result = user.setNachname(newstring);
|
||||||
|
assertTrue(result != newstring);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_setEmail() {
|
||||||
|
String newstring = "new";
|
||||||
|
String result = user.setEmail(newstring);
|
||||||
|
assertTrue(result != newstring);
|
||||||
|
}
|
||||||
|
@Test
|
||||||
|
public void test_buyPackage(){
|
||||||
|
Cards cards = user.buyPackage(myPackage);
|
||||||
|
assertTrue(cards != null);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user