diff --git a/NineChronicles.Headless.Tests/ArenaParticipantsWorkerTest.cs b/NineChronicles.Headless.Tests/ArenaParticipantsWorkerTest.cs index 887b59f4f..7d5c406c3 100644 --- a/NineChronicles.Headless.Tests/ArenaParticipantsWorkerTest.cs +++ b/NineChronicles.Headless.Tests/ArenaParticipantsWorkerTest.cs @@ -7,9 +7,11 @@ using Libplanet.Mocks; using Nekoyume; using Nekoyume.Action; +using Nekoyume.Model; using Nekoyume.Model.Arena; using Nekoyume.Model.EnumType; using Nekoyume.Model.Item; +using Nekoyume.Model.Quest; using Nekoyume.Model.State; using Nekoyume.Module; using Nekoyume.TableData; @@ -92,7 +94,8 @@ public void AvatarAddrAndScoresWithRank() .SetLegacyState(sheetAddress, csv.Serialize()) .SetLegacyState(participantsAddr, participants.Serialize()) .SetLegacyState(arenaScore.Address, arenaScore.Serialize()); - var actual = ArenaParticipantsWorker.AvatarAddrAndScoresWithRank(participants.AvatarAddresses, currentRoundData, state); + var actual = + ArenaParticipantsWorker.AvatarAddrAndScoresWithRank(participants.AvatarAddresses, currentRoundData, state); Assert.Equal(2, actual.Count); var first = actual.First(); Assert.Equal(avatarAddress, first.avatarAddr); @@ -114,7 +117,16 @@ public void GetArenaParticipants() avatarAddress, agentAddress, 0, - tableSheets.GetAvatarSheets(), + new QuestList( + tableSheets.QuestSheet, + tableSheets.QuestRewardSheet, + tableSheets.QuestItemRewardSheet, + tableSheets.EquipmentItemRecipeSheet, + tableSheets.EquipmentItemSubRecipeSheet + ), + new WorldInformation( + 0, tableSheets.WorldSheet, GameConfig.IsEditor, "test" + ), new Address(), "avatar_state" ); @@ -123,7 +135,16 @@ public void GetArenaParticipants() avatar2Address, agentAddress, 0, - tableSheets.GetAvatarSheets(), + new QuestList( + tableSheets.QuestSheet, + tableSheets.QuestRewardSheet, + tableSheets.QuestItemRewardSheet, + tableSheets.EquipmentItemRecipeSheet, + tableSheets.EquipmentItemSubRecipeSheet + ), + new WorldInformation( + 0, tableSheets.WorldSheet, GameConfig.IsEditor, "test" + ), new Address(), "avatar_state2" ); @@ -131,7 +152,9 @@ public void GetArenaParticipants() // equipment var equipmentSheet = tableSheets.EquipmentItemSheet; var random = new Random(0); - var equipment = (Equipment)ItemFactory.CreateItem(equipmentSheet.Values.First(r => r.ItemSubType == ItemSubType.Armor), random); + var equipment = + (Equipment)ItemFactory.CreateItem(equipmentSheet.Values.First(r => r.ItemSubType == ItemSubType.Armor), + random); equipment.equipped = true; avatarState.inventory.AddItem(equipment); avatarState2.inventory.AddItem(equipment); @@ -182,8 +205,12 @@ public void GetArenaParticipants() { state = state.SetLegacyState(Addresses.GetSheetAddress(key), s.Serialize()); } - var avatarAddrAndScoresWithRank = ArenaParticipantsWorker.AvatarAddrAndScoresWithRank(participants.AvatarAddresses, currentRoundData, state); - var actual = ArenaParticipantsWorker.GetArenaParticipants(state, participants.AvatarAddresses, avatarAddrAndScoresWithRank); + + var avatarAddrAndScoresWithRank = + ArenaParticipantsWorker.AvatarAddrAndScoresWithRank(participants.AvatarAddresses, currentRoundData, state); + var actual = + ArenaParticipantsWorker.GetArenaParticipants(state, participants.AvatarAddresses, + avatarAddrAndScoresWithRank); Assert.Equal(2, actual.Count); var first = actual.First(); Assert.Equal(avatarAddress, first.AvatarAddr); diff --git a/NineChronicles.Headless.Tests/Common/Fixtures.cs b/NineChronicles.Headless.Tests/Common/Fixtures.cs index 38e485719..d081b135b 100644 --- a/NineChronicles.Headless.Tests/Common/Fixtures.cs +++ b/NineChronicles.Headless.Tests/Common/Fixtures.cs @@ -6,7 +6,10 @@ using Libplanet.Common; using Libplanet.Crypto; using Libplanet.Types.Assets; +using Nekoyume; +using Nekoyume.Model; using Nekoyume.Model.Item; +using Nekoyume.Model.Quest; using Nekoyume.Model.State; namespace NineChronicles.Headless.Tests @@ -30,7 +33,15 @@ public static class Fixtures AvatarAddress, UserAddress, 0, - TableSheetsFX.GetAvatarSheets(), + new QuestList( + TableSheetsFX.GetAvatarSheets().QuestSheet, + TableSheetsFX.GetAvatarSheets().QuestRewardSheet, + TableSheetsFX.GetAvatarSheets().QuestItemRewardSheet, + TableSheetsFX.GetAvatarSheets().EquipmentItemRecipeSheet, + TableSheetsFX.GetAvatarSheets().EquipmentItemSubRecipeSheet + ), + new WorldInformation(0, TableSheetsFX.GetAvatarSheets().WorldSheet, + GameConfig.IsEditor, "test"), new Address(), "avatar_state_fx" ); @@ -54,7 +65,8 @@ public static ShopState ShopStateFX() var equipment = ItemFactory.CreateItemUsable(row, Guid.Empty, 0); if (equipment is ITradableItem tradableItem) { - var shopItem = new ShopItem(UserAddress, AvatarAddress, Guid.NewGuid(), index * CurrencyFX, tradableItem); + var shopItem = new ShopItem(UserAddress, AvatarAddress, Guid.NewGuid(), index * CurrencyFX, + tradableItem); shopState.Register(shopItem); } }