Skip to content

Commit

Permalink
Merge pull request #295 from Advanced-Programming-2021/spellsAndSpeci…
Browse files Browse the repository at this point in the history
…lMonsters

Spells and specil monsters
  • Loading branch information
amir-haji authored Jun 20, 2021
2 parents cfa739b + 7a69761 commit 8e9b248
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 211 deletions.
2 changes: 1 addition & 1 deletion src/main/java/model/user/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public User(String username, String password, String nickname) {
this.username = username;
this.password = password;
this.nickname = nickname;
this.money = 1000000000;
this.money = 100000;
this.score = 0;
this.lifepoint = new Lifepoint();
this.cardInventory = new CardInventory();
Expand Down
21 changes: 11 additions & 10 deletions src/test/java/controller/DeckControllerTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package controller;

import model.Shop;
import model.card.Card;
import model.user.User;
import org.junit.jupiter.api.AfterAll;
Expand All @@ -13,11 +14,13 @@
class DeckControllerTest {

private static DeckController deckController;
private static Shop shop;
@BeforeAll
public static void setBeforeTest() {
User user = new User("hajji", "hajji", "hajji");
user.getCardInventory().addCardToInventory(Card.getCardByName("Battle OX"));
shop = new Shop("hajji");
deckController = new DeckController("hajji");

user.getUserDeck().createDeck("deck1", user);
user.getUserDeck().createDeck("deckTwo", user);
}
Expand All @@ -42,12 +45,11 @@ void getActiveDeckStr() {
assertEquals(strExpected, deckController.getActiveDeckStr());
User.getUserByUsername("hajji").getUserDeck().deleteDeckFromUserDecks("deck1");
assertFalse(User.getUserByUsername("hajji").getUserDeck().doesDeckExist("deck1"));
// here we hava bug -haji
//assertEquals("", deckController.getActiveDeckStr());
}

@Test
void getAllCardsStr() {
shop.buy("Battle OX");
String strExpected = "Battle OX:A monster with tremendous power, it destroys enemies with a swing of its axe.";
ArrayList<String> expected = new ArrayList<>();
expected.add(strExpected);
Expand All @@ -56,8 +58,6 @@ void getAllCardsStr() {

@Test
void getOtherDeckStr() {
//String strExpected = "deck3: main deck 0, side deck 0, valid, "
// + "deckTwo: main deck 0, side deck 0, valid";
ArrayList<String> expected = new ArrayList<>();
expected.add("deck3: main deck 0, side deck 0, valid");
expected.add("deckTwo: main deck 0, side deck 0, valid");
Expand All @@ -74,11 +74,12 @@ void deleteDeckErrorHandler() {
@Test
void removeCardErrorHandler() {
User user = User.getUserByUsername("hajji");
user.getCardInventory().addCardToInventory(Card.getCardByName("Horn Imp"));
user.getCardInventory().addCardToInventory(Card.getCardByName("Horn Imp"));
user.getCardInventory().addCardToInventory(Card.getCardByName("Trap Hole"));
user.getCardInventory().addCardToInventory(Card.getCardByName("Axe Raider"));
user.getCardInventory().addCardToInventory(Card.getCardByName("Suijin"));
shop.buy("Horn Imp");
shop.buy("Horn Imp");
shop.buy("Trap Hole");
shop.buy("Axe Raider");
shop.buy("Suijin");

user.getUserDeck().getDeckByName("deck3").addCard("Horn Imp", false, user);
user.getUserDeck().getDeckByName("deck3").addCard("Horn Imp", true, user);
user.getUserDeck().getDeckByName("deck3").addCard("Trap Hole", false, user);
Expand Down
44 changes: 0 additions & 44 deletions src/test/java/controller/ScoreboardControllerTest.java

This file was deleted.

1 change: 0 additions & 1 deletion src/test/java/controller/ShopControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ public static void setBeforeTest() {
@Test
void buyCardErrorHandler() throws IOException {
assertEquals(1, shopController.buyCardErrorHandler("hajji"));
assertEquals(2, shopController.buyCardErrorHandler("Horn Imp"));
assertEquals(0, shopController.buyCardErrorHandler("Yomi Ship"));
}

Expand Down
84 changes: 0 additions & 84 deletions src/test/java/model/ScoreboardTest.java

This file was deleted.

Loading

0 comments on commit 8e9b248

Please sign in to comment.