Skip to content

Commit

Permalink
Testing OutType for MaLigue2
Browse files Browse the repository at this point in the history
  • Loading branch information
axel3rd committed Aug 21, 2021
1 parent 645e5fb commit 64ea60c
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.apache.commons.io.FileUtils;
import org.blondin.mpg.AbstractMockTestClient;
import org.blondin.mpg.config.Config;
import org.blondin.mpg.out.model.OutType;
import org.blondin.mpg.out.model.Player;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
Expand Down Expand Up @@ -48,6 +49,23 @@ public void testCheckTeams2021L2() throws Exception {
}
}

@Test
public void testReasons() throws Exception {
InjuredSuspendedMaLigue2Client client = spy(InjuredSuspendedMaLigue2Client.build(null));
doReturn(
FileUtils.readFileToString(new File(TESTFILES_BASE, "maligue2.joueurs-blesses-et-suspendus.20210804.html"), Charset.forName("UTF-8")))
.when(client).getHtmlContent();

Assert.assertNotNull("Absent : Diallo (JO) / AC Ajaccio", client.getPlayer("Diallo", "Ajaccio"));
Assert.assertEquals("Absent : Diallo (JO) / AC Ajaccio", OutType.ASBENT, client.getPlayer("Diallo", "Ajaccio").getOutType());
Assert.assertNotNull("Absent : Gioacchini (Gold Cup) / SM Caen", client.getPlayer("Gioacchini", "Caen"));
Assert.assertEquals("Absent : Gioacchini (Gold Cup) / SM Caen", OutType.ASBENT, client.getPlayer("Gioacchini", "Caen").getOutType());
Assert.assertNotNull("Injuries : Vandermersch / SM Caen", client.getPlayer("Vandermersch", "Caen"));
Assert.assertEquals("Injuries : Vandermersch / SM Caen", OutType.INJURY_RED, client.getPlayer("Vandermersch", "Caen").getOutType());
Assert.assertNotNull("Suspended : Traoré (J3) / Dijon FCO", client.getPlayer("Traore", "Dijon"));
Assert.assertEquals("Suspended : Traoré (J3) / Dijon FCO", OutType.SUSPENDED, client.getPlayer("Traore", "Dijon").getOutType());
}

@Test
public void testInjuriesSameName() throws Exception {
InjuredSuspendedMaLigue2Client client = spy(InjuredSuspendedMaLigue2Client.build(null));
Expand Down

0 comments on commit 64ea60c

Please sign in to comment.