-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
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
43 changes: 43 additions & 0 deletions
43
xivsupport/src/test/java/gg/xp/xivsupport/events/fflogs/FflogsReportLocatorTest.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,43 @@ | ||
package gg.xp.xivsupport.events.fflogs; | ||
|
||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.Assert.*; | ||
|
||
public class FflogsReportLocatorTest { | ||
|
||
@Test | ||
void testNonFightUrl() { | ||
FflogsReportLocator locator = FflogsReportLocator.fromURL("https://www.fflogs.com/reports/JX23Kd1YRyBtxkDZ"); | ||
Assert.assertEquals(locator.report(), "JX23Kd1YRyBtxkDZ"); | ||
Assert.assertNull(locator.fight()); | ||
Assert.assertFalse(locator.fightSpecified()); | ||
} | ||
|
||
@Test | ||
void testOldFightUrl() { | ||
FflogsReportLocator locator = FflogsReportLocator.fromURL("https://www.fflogs.com/reports/JX23Kd1YRyBtxkDZ#fight=3"); | ||
Assert.assertEquals(locator.report(), "JX23Kd1YRyBtxkDZ"); | ||
Assert.assertEquals(locator.fight(), 3); | ||
Assert.assertTrue(locator.fightSpecified()); | ||
} | ||
|
||
@Test | ||
void testNewFightUrl() { | ||
FflogsReportLocator locator = FflogsReportLocator.fromURL("https://www.fflogs.com/reports/JX23Kd1YRyBtxkDZ?fight=3"); | ||
Assert.assertEquals(locator.report(), "JX23Kd1YRyBtxkDZ"); | ||
Assert.assertEquals(locator.fight(), 3); | ||
Assert.assertTrue(locator.fightSpecified()); | ||
} | ||
|
||
@Test | ||
void testNewFightUrlWithJunk() { | ||
FflogsReportLocator locator = FflogsReportLocator.fromURL("https://www.fflogs.com/reports/JX23Kd1YRyBtxkDZ?foo=bar&fight=3&baz=true"); | ||
Assert.assertEquals(locator.report(), "JX23Kd1YRyBtxkDZ"); | ||
Assert.assertEquals(locator.fight(), 3); | ||
Assert.assertTrue(locator.fightSpecified()); | ||
} | ||
|
||
|
||
} |