Skip to content

Commit

Permalink
update test code for try parse reward
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrosine1153 committed Oct 22, 2024
1 parent 25861f9 commit f9d7217
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .Lib9c.Tests/TableData/WorldBossRankingRewardSheetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public class WorldBossRankingRewardSheetTest
14,900002,11,100,0,0,10011,560,10012,150,10013,40,1500000,600201,100,500000,1000
15,900002,0,0,1,30,10011,370,10012,105,10013,25,500000,600201,50,500000,100
16,900002,0,0,31,50,10011,230,10012,60,10013,10,250000,600201,50,500000,100
17,900002,0,0,51,70,10011,75,10012,20,10013,5,125000,600201,50,500000,100
18,900002,0,0,71,100,10011,40,10012,10,0,0,100000,600201,50,500000,100
17,900002,0,0,51,70,10011,75,10012,20,10013,5,125000,600201,50,0,0
18,900002,0,0,71,100,10011,40,10012,10,0,0,100000,600201,50,,
";

[Fact]
Expand Down Expand Up @@ -68,16 +68,19 @@ public void FIndRow_Throw_ArgumentException()
Assert.Throws<ArgumentException>(() => sheet.FindRow(900003, 0, 0));
}

[Fact]
public void GetRewards()
[Theory]
[InlineData(900001, 1, 0, 6)]
[InlineData(900002, 600, 60, 5)]
[InlineData(900002, 800, 80, 4)]
public void GetRewards(int bossId, int ranking, int rate, int expected)
{
var sheet = new WorldBossRankingRewardSheet();
sheet.Set(Csv);
var row = sheet.FindRow(900001, 1, 0);
var row = sheet.FindRow(bossId, ranking, rate);
var tableSheets = new TableSheets(TableSheetsImporter.ImportSheets());
var rewards = row.GetRewards(tableSheets.RuneSheet, tableSheets.MaterialItemSheet);

Assert.Equal(6, rewards.Count);
Assert.Equal(expected, rewards.Count);
}
}
}

0 comments on commit f9d7217

Please sign in to comment.