Skip to content

Commit

Permalink
Fix ClaimGiftsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ipdae committed Dec 27, 2024
1 parent 60a231c commit 4087bc8
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions .Lib9c.Tests/Action/ClaimGiftsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ public ClaimGiftsTest()
_tableSheets = new TableSheets(tableCsv);
}

[Theory]
[InlineData(1)]
[InlineData(300)]
[InlineData(600)]
[InlineData(1200)]
public void Execute_Success(long blockIndex)
[Fact]
public void Execute_Success()
{
var agentAddress = new PrivateKey().Address;
var avatarAddress = Addresses.GetAvatarAddress(agentAddress, 0);
Expand All @@ -47,20 +43,18 @@ public void Execute_Success(long blockIndex)
_tableSheets.GetAvatarSheets(),
default);
var state = _state.SetAvatarState(avatarAddress, avatarState);

if (!_tableSheets.ClaimableGiftsSheet.TryFindRowByBlockIndex(blockIndex, out var row))
var row = _tableSheets.ClaimableGiftsSheet.Values.FirstOrDefault(r => r.StartedBlockIndex > 0L);
if (row is not null)
{
throw new Exception();
Execute(
state,
avatarAddress,
agentAddress,
row.Id,
row.StartedBlockIndex,
row.Items.ToArray()
);
}

Execute(
state,
avatarAddress,
agentAddress,
row.Id,
blockIndex,
row.Items.ToArray()
);
}

[Fact]
Expand Down

0 comments on commit 4087bc8

Please sign in to comment.