forked from nus-cs2103-AY1920S1/addressbook-level3
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from tohcejasmine/finance
Fix Finance UI buggy and update PPP
- Loading branch information
Showing
6 changed files
with
78 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.Scene?> | ||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.image.Image?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.stage.Stage?> | ||
|
||
<fx:root resizable="false" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1"> | ||
<icons> | ||
<Image url="@/images/help_icon.png" /> | ||
</icons> | ||
<scene> | ||
<Scene> | ||
<HBox alignment="CENTER"> | ||
<children> | ||
<Label fx:id="helpMessage" text="Label"> | ||
<HBox.margin> | ||
<Insets right="5.0" /> | ||
</HBox.margin> | ||
</Label> | ||
<Button fx:id="copyButton" mnemonicParsing="false" onAction="#copyUrl" text="Copy URL"> | ||
<HBox.margin> | ||
<Insets left="5.0" /> | ||
</HBox.margin> | ||
</Button> | ||
</children> | ||
<opaqueInsets> | ||
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" /> | ||
</opaqueInsets> | ||
<padding> | ||
<Insets bottom="10.0" left="5.0" right="10.0" top="5.0" /> | ||
</padding> | ||
</HBox> | ||
</Scene> | ||
</scene> | ||
</fx:root> |
34 changes: 34 additions & 0 deletions
34
src/test/java/seedu/address/model/finance/budget/BudgetTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package seedu.address.model.finance.budget; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
import static seedu.address.testutil.Assert.assertThrows; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class BudgetTest { | ||
|
||
@Test | ||
public void constructor_null_throwsNullPointerException() { | ||
assertThrows(NullPointerException.class, () -> | ||
new Budget(null, null, null, null, null)); | ||
} | ||
|
||
@Test | ||
public void isValidBudgetType() { | ||
// null budget type | ||
assertThrows(NullPointerException.class, () -> Budget.isValidBudgetType(null)); | ||
|
||
// invalid budget type | ||
assertFalse(Budget.isValidBudgetType("")); // empty string | ||
assertFalse(Budget.isValidBudgetType(" ")); // spaces only | ||
assertFalse(Budget.isValidBudgetType("^")); // only non-alphanumeric characters | ||
assertFalse(Budget.isValidBudgetType("peter*")); // contains non-alphanumeric characters | ||
|
||
// valid budget type | ||
assertTrue(Budget.isValidBudgetType("all")); | ||
assertTrue(Budget.isValidBudgetType("met")); | ||
assertTrue(Budget.isValidBudgetType("place")); | ||
assertTrue(Budget.isValidBudgetType("cat")); | ||
} | ||
} |