-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Small fixes and deleted organizationTest
- Loading branch information
AdrianBalunan
committed
Mar 15, 2026
1 parent
facf2fc
commit ac74eff
Showing
5 changed files
with
97 additions
and
104 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
67 changes: 0 additions & 67 deletions
67
...mehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/APICharityDataTest.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
helpmehelpapplication/src/test/java/ntnu/systemutvikling/team6/models/OrganizationTest.java
This file was deleted.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
...ehelpapplication/src/test/java/ntnu/systemutvikling/team6/scraper/APICharityDataTest.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,96 @@ | ||
| package ntnu.systemutvikling.team6.scraper; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| class APICharityDataTest { | ||
|
|
||
| @Test | ||
| void initialParametersShouldBeCorrect() { | ||
| APICharityData charity = | ||
| new APICharityData( | ||
| "938419264", | ||
| "Misjonsalliansen", | ||
| "approved", | ||
| "https://www.innsamlingskontrollen.no/organisasjoner/misjonsalliansen/", | ||
| false); | ||
|
|
||
| assertEquals( | ||
| "938419264", | ||
| charity.getOrg_number(), | ||
| "Org_number parameter of APICharityData should be correct."); | ||
| assertEquals( | ||
| "Misjonsalliansen", | ||
| charity.getName(), | ||
| "Name parameter of APICharityData should be correct."); | ||
| assertEquals( | ||
| "approved", charity.getStatus(), "Status parameter of APICharityData should be correct."); | ||
| assertEquals( | ||
| "https://www.innsamlingskontrollen.no/organisasjoner/misjonsalliansen/", | ||
| charity.getUrl(), | ||
| "Url parameter of APICharityData should be correct."); | ||
| assertFalse( | ||
| charity.getIs_pre_approved(), | ||
| "Is_pre_approved parameter of APICharityData should " + "be correct."); | ||
| } | ||
|
|
||
| @Test | ||
| void org_numberWhiteSpaceShouldBeremoved() { | ||
| String org_number = "938 4192 64"; | ||
| APICharityData charity = | ||
| new APICharityData( | ||
| org_number, | ||
| "Misjonsalliansen", | ||
| "approved", | ||
| "https://www.innsamlingskontrollen.no/organisasjoner/misjonsalliansen/", | ||
| false); | ||
|
|
||
| assertEquals( | ||
| org_number.replaceAll("\\s", ""), | ||
| charity.getOrg_number(), | ||
| "Org_number should not contain whitespace."); | ||
| } | ||
|
|
||
| @Test | ||
| void nullOrg_numberShouldThrowIllegalArgumentException() { | ||
| assertThrows( | ||
| IllegalArgumentException.class, | ||
| () -> | ||
| new APICharityData( | ||
| null, | ||
| "Misjonsalliansen", | ||
| "approved", | ||
| "https://www.innsamlingskontrollen.no/organisasjoner/misjonsalliansen/", | ||
| false), | ||
| "Null org_number should not be allowed."); | ||
| } | ||
|
|
||
| @Test | ||
| void blankOrg_numberShouldThrowIllegalArgumentException() { | ||
| assertThrows( | ||
| IllegalArgumentException.class, | ||
| () -> | ||
| new APICharityData( | ||
| " ", | ||
| "Misjonsalliansen", | ||
| "approved", | ||
| "https://www.innsamlingskontrollen.no/organisasjoner/misjonsalliansen/", | ||
| false), | ||
| "Blank org_number should not be allowed."); | ||
| } | ||
|
|
||
| @Test | ||
| void emptyOrg_numberShouldThrowIllegalArgumentException() { | ||
| assertThrows( | ||
| IllegalArgumentException.class, | ||
| () -> | ||
| new APICharityData( | ||
| "", | ||
| "Misjonsalliansen", | ||
| "approved", | ||
| "https://www.innsamlingskontrollen.no/organisasjoner/misjonsalliansen/", | ||
| false), | ||
| "Null org_number should not be allowed."); | ||
| } | ||
| } |