Skip to content

Commit

Permalink
Merge pull request #93 from ItalyToast/gg-tests-cleanup
Browse files Browse the repository at this point in the history
GG tests cleanup
  • Loading branch information
ItalyToast authored Dec 3, 2023
2 parents 34172cc + 1664361 commit f5b8347
Show file tree
Hide file tree
Showing 17 changed files with 350 additions and 232 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace HandHistories.Parser.UnitTests.FileIdentifiers
{
[TestFixture("PokerStars")]
[TestFixture("GGPoker")]
[TestFixture("OnGame")]
[TestFixture("IPoker")]
[TestFixture("Pacific")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,21 +386,30 @@
<None Update="SampleHandHistories\FullTilt\CashGame\ValidHandTests\ValidHand_1.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GameTypeTests\NoLimitHoldem.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GameTypeTests\PotLimitOmaha.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\MultiplePosts.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\PaysCashoutFee.txt">
<None Update="SampleHandHistories\GGPoker\CashGame\HandActionTests\PaysCashoutFee.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\PostMissingBlind.txt">
<None Update="SampleHandHistories\GGPoker\CashGame\HandActionTests\PostingDead.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\ReceivesCashout.txt">
<None Update="SampleHandHistories\GGPoker\CashGame\HandActionTests\ReceivesCashout.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\Regular.txt">
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\GeneralHand.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\Regular.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\RunThreeTimes.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand All @@ -410,6 +419,9 @@
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\RushAndCash.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\HandActionTests\BasicHand.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="SampleHandHistories\GGPoker\CashGame\GeneralHands\Straddle.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -1798,4 +1810,8 @@
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="SampleHandHistories\GGPoker\CashGame\Limits\" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -557,233 +557,5 @@ public void RunThreeTimes()
TestFullHandHistorySummary(expectedSummary, "RunThreeTimes");
TestHandHistory(expectedHandHistory, "RunThreeTimes");
}
[Test]
public void PostingMissingBlind()
{
HandHistorySummary expectedSummary = new HandHistorySummary()
{
GameDescription = new GameDescriptor()
{
PokerFormat = PokerFormat.CashGame,
GameType = GameType.NoLimitHoldem,
Limit = Limit.FromSmallBlindBigBlind(0.5m, 1m, Currency.USD),
SeatType = SeatType.FromMaxPlayers(6),
Site = SiteName.GGPoker,
TableType = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
},
DateOfHandUtc = new DateTime(2018, 12, 28, 11, 00, 52),
DealerButtonPosition = 5,
HandId = HandID.From(54233001),
NumPlayersSeated = 6,
TableName = "NLHGold19",
TotalPot = 12,
Rake = 0.6m,
Jackpot = 0,
Bingo = 0
};
HandHistory expectedHandHistory = new HandHistory()
{
CommunityCards = BoardCards.FromCards("Kc4c2h"),
Players = new PlayerList(new List<Player>
{
new Player("343kk954", 60, 1),
new Player("Hero", 100.23m, 2, HoleCards.FromCards("ks2d")),
new Player("b4mnx231", 175.41m, 3),
new Player("15yfdsaa", 20, 4),
new Player("mkacefi1a", 22.84m, 5),
new Player("142dsaca", 98.5m, 6),
}),
Hero = new Player("Hero", 100.23m, 2, HoleCards.FromCards("ks2d")),
RunItMultipleTimes = new RunItTwice[]
{
new RunItTwice
{
Board = BoardCards.FromCards("Kc4c2h"),
Actions = new List<HandAction> { },
Winners = new List<WinningsAction>
{
new WinningsAction("15yfdsaa", WinningsActionType.WINS, 11.4m, 0)
}
},
new RunItTwice {},
new RunItTwice {}
},
Winners = new List<WinningsAction>() { new WinningsAction("15yfdsaa", WinningsActionType.WINS, 11.4m, 0) },
HandActions = new List<HandAction>() {
new HandAction("142dsaca", HandActionType.SMALL_BLIND, -0.5m, Street.Preflop),
new HandAction("343kk954", HandActionType.BIG_BLIND, -1, Street.Preflop),
new HandAction("15yfdsaa", HandActionType.POSTS_DEAD, -0.5m, Street.Preflop),
new HandAction("15yfdsaa", HandActionType.POSTS, -1, Street.Preflop),
new HandAction("Hero", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("b4mnx231", HandActionType.CALL, 1, Street.Preflop),
new HandAction("15yfdsaa", HandActionType.RAISE, 4m, Street.Preflop),
new HandAction("mkacefi1a", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("142dsaca", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("343kk954", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("b4mnx231", HandActionType.CALL, 4, Street.Preflop),
new HandAction("b4mnx231", HandActionType.CHECK, 0, Street.Flop),
new HandAction("15yfdsaa", HandActionType.BET, 12, Street.Flop),
new HandAction("b4mnx231", HandActionType.FOLD, 0, Street.Flop),
new HandAction("15yfdsaa", HandActionType.UNCALLED_BET, 12, Street.Flop),
}
};
TestFullHandHistorySummary(expectedSummary, "PostMissingBlind");
TestHandHistory(expectedHandHistory, "PostMissingBlind");
}

[Test]
public void ReceivesCashout()
{
HandHistorySummary expectedSummary = new HandHistorySummary()
{
GameDescription = new GameDescriptor()
{
PokerFormat = PokerFormat.CashGame,
GameType = GameType.NoLimitHoldem,
Limit = Limit.FromSmallBlindBigBlind(0.25m, 0.5m, Currency.USD),
SeatType = SeatType.FromMaxPlayers(6),
Site = SiteName.GGPoker,
TableType = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
},
DateOfHandUtc = new DateTime(2019, 1, 11, 9, 15, 6),
DealerButtonPosition = 1,
HandId = HandID.From(2281523),
NumPlayersSeated = 6,
TableName = "NLHBronze21",
TotalPot = 16.07m,
Rake = 0.77m,
Jackpot = 0.5m,
Bingo = 0
};
HandHistory expectedHandHistory = new HandHistory()
{
CommunityCards = BoardCards.FromCards("TsQc4d9hAc"),
Players = new PlayerList(new List<Player>
{
new Player("c12290be", 22, 1),
new Player("1xfd8bbx", 123.61m, 2),
new Player("88989dfa", 116.2m, 3, HoleCards.FromCards("6s6d")),
new Player("fdfa4dax", 7, 4, HoleCards.FromCards("Ah5h")),
new Player("fdac21ts", 52.5m, 5),
new Player("Hero", 95.82m, 6, HoleCards.FromCards("2h8h")),
}),
Hero = new Player("Hero",95.82m, 6, HoleCards.FromCards("2h8h")),
RunItMultipleTimes = new RunItTwice[]
{
new RunItTwice
{
Board = BoardCards.FromCards("TsQc4d9hAc"),
Actions = new List<HandAction> { },
Winners = new List<WinningsAction>
{
new WinningsAction("88989dfa", WinningsActionType.INSURANCE, 9.98m, 0),
new WinningsAction("fdfa4dax", WinningsActionType.WINS, 14.8m, 0),
}
},
new RunItTwice {},
new RunItTwice {}
},
Winners = new List<WinningsAction>()
{
new WinningsAction("88989dfa", WinningsActionType.INSURANCE, 9.98m, 0),
new WinningsAction("fdfa4dax", WinningsActionType.WINS, 14.8m, 0)
},
HandActions = new List<HandAction>() {
new HandAction("1xfd8bbx", HandActionType.SMALL_BLIND, -0.25m, Street.Preflop),
new HandAction("88989dfa", HandActionType.BIG_BLIND, -0.5m, Street.Preflop),
new HandAction("fdfa4dax", HandActionType.CALL, 0.5m, Street.Preflop),
new HandAction("fdac21ts", HandActionType.RAISE, 1.82m, Street.Preflop),
new HandAction("Hero", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("c12290be", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("1xfd8bbx", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("88989dfa", HandActionType.CALL, 1.32m, Street.Preflop),
new HandAction("fdfa4dax", HandActionType.RAISE, 6.5m, Street.Preflop, true),
new HandAction("fdac21ts", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("88989dfa", HandActionType.CALL, 5.18m, Street.Preflop),
new HandAction("fdfa4dax", HandActionType.SHOW, Street.Showdown),
new HandAction("88989dfa", HandActionType.SHOW, Street.Showdown),
}
};

TestFullHandHistorySummary(expectedSummary, "ReceivesCashout");
TestHandHistory(expectedHandHistory, "ReceivesCashout");
}

[Test]
public void PaysCashoutFee()
{
HandHistorySummary expectedSummary = new HandHistorySummary()
{
GameDescription = new GameDescriptor()
{
PokerFormat = PokerFormat.CashGame,
GameType = GameType.NoLimitHoldem,
Limit = Limit.FromSmallBlindBigBlind(1m, 2m, Currency.USD),
SeatType = SeatType.FromMaxPlayers(6),
Site = SiteName.GGPoker,
TableType = TableType.FromTableTypeDescriptions(TableTypeDescription.Regular)
},
DateOfHandUtc = new DateTime(2019, 1, 22, 19, 56, 3),
DealerButtonPosition = 4,
HandId = HandID.From(149101),
NumPlayersSeated = 6,
TableName = "NLHGold14",
TotalPot = 251.86m,
Rake = 6m,
Jackpot = 2m,
Bingo = 0
};

HandHistory expectedHandHistory = new HandHistory()
{
CommunityCards = BoardCards.FromCards("8d9h2cTsQh"),
Players = new PlayerList(new List<Player>
{
new Player("vda35fd1", 512.43m, 1),
new Player("fma3fca1", 52.19m, 2),
new Player("oiesfcv1", 146.39m, 3, HoleCards.FromCards("KdKc")),
new Player("Hero", 103m, 4, HoleCards.FromCards("Qs6h")),
new Player("tyx36123", 122.73m, 5, HoleCards.FromCards("3d3h")),
new Player("b6887901", 100.81m, 6),
}),
Hero = new Player("Hero", 103m, 4, HoleCards.FromCards("Qs6h")),
RunItMultipleTimes = new RunItTwice[]
{
new RunItTwice
{
Board = BoardCards.FromCards("8d9h2cTsQh"),
Actions = new List<HandAction> { },
Winners = new List<WinningsAction>
{
new WinningsAction("oiesfcv1", WinningsActionType.WINS, 243.86m, 0),
}
},
new RunItTwice {},
new RunItTwice {}
},
Winners = new List<WinningsAction>()
{
new WinningsAction("oiesfcv1", WinningsActionType.WINS, 243.86m, 0),
},
HandActions = new List<HandAction>() {
new HandAction("tyx36123", HandActionType.SMALL_BLIND, -1m, Street.Preflop),
new HandAction("b6887901", HandActionType.BIG_BLIND, -2m, Street.Preflop),
new HandAction("vda35fd1", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("fma3fca1", HandActionType.RAISE, 4.4m, Street.Preflop),
new HandAction("oiesfcv1", HandActionType.CALL, 4.4m, Street.Preflop),
new HandAction("Hero", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("tyx36123", HandActionType.RAISE, 121.73m, Street.Preflop, true),
new HandAction("b6887901", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("fma3fca1", HandActionType.FOLD, 0, Street.Preflop),
new HandAction("oiesfcv1", HandActionType.CALL, 118.33m, Street.Preflop),
new HandAction("tyx36123", HandActionType.SHOW, 0m, Street.Showdown),
new HandAction("oiesfcv1", HandActionType.SHOW, 0m, Street.Showdown),
new HandAction("oiesfcv1", HandActionType.PAYS_INSURANCE_FEE, 22.68m, Street.Showdown),
},
};

TestFullHandHistorySummary(expectedSummary, "PaysCashoutFee");
TestHandHistory(expectedHandHistory, "PaysCashoutFee");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public void ParseHandActions_OmahaHiLoHands()
case SiteName.Winamax:
case SiteName.Pacific:
case SiteName.WinningPoker:
case SiteName.GGPoker:
Assert.Ignore("No example for omaha hi-lo hands for site " + Site);
break;
}
Expand Down
Loading

0 comments on commit f5b8347

Please sign in to comment.