Skip to content

Commit

Permalink
delete reference of new action from test code
Browse files Browse the repository at this point in the history
  • Loading branch information
tyrosine1153 committed Nov 1, 2023
1 parent 65b6789 commit 825be37
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .Lib9c.Tests/Action/BuyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public void Execute(params OrderData[] orderDataList)
Signer = _buyerAgentAddress,
});

var buyProductAction = new BuyProduct
var buyProductAction = new BuyProduct2
{
AvatarAddress = _buyerAvatarAddress,
ProductInfos = productInfos,
Expand Down Expand Up @@ -630,7 +630,7 @@ public void Execute_ErrorCode(ErrorCodeMember errorCodeMember)
action.errors.Select(r => r.errorCode)
);

var buyProductAction = new BuyProduct
var buyProductAction = new BuyProduct2
{
AvatarAddress = _buyerAvatarAddress,
ProductInfos = new[] { productInfo },
Expand Down
6 changes: 3 additions & 3 deletions .Lib9c.Tests/Action/MarketValidationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void Validate_RegisterInfo(params RegisterInfosMember[] validateMembers)
{
foreach (var registerInfo in validateMember.RegisterInfos)
{
var registerProduct = new RegisterProduct
var registerProduct = new RegisterProduct2
{
AvatarAddress = AvatarAddress,
RegisterInfos = new[] { registerInfo },
Expand Down Expand Up @@ -237,15 +237,15 @@ public void Validate_ProductInfo(params ProductInfosMember[] validateMembers)
{
foreach (var productInfo in validateMember.ProductInfos)
{
var buyProduct = new BuyProduct
var buyProduct = new BuyProduct2
{
AvatarAddress = AvatarAddress,
ProductInfos = new[] { productInfo },
};

Assert.Throws(validateMember.Exc, () => buyProduct.Execute(actionContext));

var cancelRegister = new CancelProductRegistration
var cancelRegister = new CancelProductRegistration0
{
AvatarAddress = AvatarAddress,
ProductInfos = new List<IProductInfo>() { productInfo },
Expand Down
2 changes: 1 addition & 1 deletion .Lib9c.Tests/Action/Scenario/ArenaScenarioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public IAccount JoinArena(
var preCurrency = roundData.EntranceFee * _crystal;
_state = _state.MintAsset(context, signer, preCurrency);

var action = new JoinArena()
var action = new JoinArena3()
{
championshipId = roundData.ChampionshipId,
round = roundData.Round,
Expand Down
10 changes: 5 additions & 5 deletions .Lib9c.Tests/Action/Scenario/AuraScenarioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void HackAndSlash()
var itemSlotStateAddress = ItemSlotState.DeriveAddress(_avatarAddress, BattleType.Adventure);
Assert.Null(_initialState.GetState(itemSlotStateAddress));

var has = new HackAndSlash
var has = new HackAndSlash21
{
StageId = 1,
AvatarAddress = _avatarAddress,
Expand Down Expand Up @@ -154,7 +154,7 @@ public void Raid()
avatarState.worldInformation.Serialize()
);

var raid = new Raid
var raid = new Raid6
{
AvatarAddress = _avatarAddress,
EquipmentIds = new List<Guid>
Expand Down Expand Up @@ -197,7 +197,7 @@ public void Arena()
avatarState.worldInformation.Serialize()
);

var join = new JoinArena
var join = new JoinArena3
{
avatarAddress = avatarAddress,
championshipId = 1,
Expand Down Expand Up @@ -227,7 +227,7 @@ public void Arena()
var enemyAvatarAddress = avatarAddress.Equals(_avatarAddress)
? _enemyAvatarAddress
: _avatarAddress;
var battle = new BattleArena
var battle = new BattleArena13
{
myAvatarAddress = avatarAddress,
enemyAvatarAddress = enemyAvatarAddress,
Expand Down Expand Up @@ -328,7 +328,7 @@ public void Market()
_avatarAddress.Derive(LegacyWorldInformationKey),
avatarState.worldInformation.Serialize());

var register = new RegisterProduct
var register = new RegisterProduct2
{
AvatarAddress = _avatarAddress,
RegisterInfos = new List<IRegisterInfo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public void Case(int randomSeed, int[] optionNumbers)
e.RequiredGold == 0);
var recipeRow =
_tableSheets.EquipmentItemRecipeSheet.OrderedList.First(e => e.SubRecipeIds.Contains(subRecipeRow.Id));
var combinationEquipmentAction = new CombinationEquipment
var combinationEquipmentAction = new CombinationEquipment16
{
avatarAddress = _avatarAddress,
slotIndex = 0,
Expand Down
8 changes: 4 additions & 4 deletions .Lib9c.Tests/Action/Scenario/ItemCraftTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void CraftEquipmentTest(int randomSeed, int[] targetItemIdList)
);

// Do Combination Action
var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = i,
Expand Down Expand Up @@ -205,7 +205,7 @@ public void CraftConsumableTest(int randomSeed, int[] targetItemIdList)
{
// Do combination action
var recipe = recipeList[i];
var action = new CombinationConsumable
var action = new CombinationConsumable8
{
avatarAddress = _avatarAddr,
slotIndex = i,
Expand Down Expand Up @@ -288,7 +288,7 @@ int[] targetItemIdList
var eventRow = _tableSheets.EventScheduleSheet[eventScheduleId];
// Do combination action
var recipe = recipeList[i];
var action = new EventConsumableItemCrafts
var action = new EventConsumableItemCrafts0
{
AvatarAddress = _avatarAddr,
EventScheduleId = eventScheduleId,
Expand Down Expand Up @@ -386,7 +386,7 @@ int[] targetItemIdList
}
}

var action = new EventMaterialItemCrafts
var action = new EventMaterialItemCrafts0
{
AvatarAddress = _avatarAddr,
EventScheduleId = eventScheduleId,
Expand Down
28 changes: 14 additions & 14 deletions .Lib9c.Tests/Action/Scenario/MarketScenarioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public void Register_And_Buy()

var random = new TestRandom();
var productInfoList = new List<IProductInfo>();
var action = new RegisterProduct
var action = new RegisterProduct2
{
AvatarAddress = _sellerAvatarAddress,
RegisterInfos = new List<IRegisterInfo>
Expand Down Expand Up @@ -166,7 +166,7 @@ public void Register_And_Buy()
});
var nextAvatarState = nextState.GetAvatarStateV2(_sellerAvatarAddress);
Assert.Empty(nextAvatarState.inventory.Items);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct.CostAp, nextAvatarState.actionPoint);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct2.CostAp, nextAvatarState.actionPoint);

var productsState =
new ProductsState((List)nextState.GetState(ProductsState.DeriveAddress(_sellerAvatarAddress)));
Expand Down Expand Up @@ -209,7 +209,7 @@ public void Register_And_Buy()
}
}

var action2 = new RegisterProduct
var action2 = new RegisterProduct2
{
AvatarAddress = _sellerAvatarAddress2,
RegisterInfos = new List<IRegisterInfo>
Expand Down Expand Up @@ -240,7 +240,7 @@ public void Register_And_Buy()
});
var nextAvatarState2 = nextState2.GetAvatarStateV2(_sellerAvatarAddress2);
Assert.Empty(nextAvatarState2.inventory.Items);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct.CostAp, nextAvatarState2.actionPoint);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct2.CostAp, nextAvatarState2.actionPoint);

var productList2 =
new ProductsState((List)nextState2.GetState(ProductsState.DeriveAddress(_sellerAvatarAddress2)));
Expand Down Expand Up @@ -283,7 +283,7 @@ public void Register_And_Buy()
}
}

var action3 = new BuyProduct
var action3 = new BuyProduct2
{
AvatarAddress = _buyerAvatarAddress,
ProductInfos = productInfoList,
Expand Down Expand Up @@ -358,7 +358,7 @@ public void Register_And_Cancel()
_initialState = _initialState
.SetState(_sellerAvatarAddress, _sellerAvatarState.Serialize())
.MintAsset(context, _sellerAvatarAddress, 1 * RuneHelper.StakeRune);
var action = new RegisterProduct
var action = new RegisterProduct2
{
AvatarAddress = _sellerAvatarAddress,
RegisterInfos = new List<IRegisterInfo>
Expand Down Expand Up @@ -398,7 +398,7 @@ public void Register_And_Cancel()

var nextAvatarState = nextState.GetAvatarStateV2(_sellerAvatarAddress);
Assert.Empty(nextAvatarState.inventory.Items);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct.CostAp, nextAvatarState.actionPoint);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct2.CostAp, nextAvatarState.actionPoint);

var marketState = new MarketState(nextState.GetState(Addresses.Market));
Assert.Contains(_sellerAvatarAddress, marketState.AvatarAddresses);
Expand Down Expand Up @@ -441,7 +441,7 @@ public void Register_And_Cancel()
}

Assert.All(new[] { nonFungibleProductId, fungibleProductId, assetProductId }, productId => Assert.NotEqual(default, productId));
var action2 = new CancelProductRegistration
var action2 = new CancelProductRegistration0
{
AvatarAddress = _sellerAvatarAddress,
ProductInfos = new List<IProductInfo>
Expand Down Expand Up @@ -493,7 +493,7 @@ public void Register_And_Cancel()
);
}

Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct.CostAp - CancelProductRegistration.CostAp, latestAvatarState.actionPoint);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct2.CostAp - CancelProductRegistration0.CostAp, latestAvatarState.actionPoint);

var sellProductList = new ProductsState((List)latestState.GetState(productsStateAddress));
Assert.Empty(sellProductList.ProductIds);
Expand Down Expand Up @@ -530,7 +530,7 @@ public void Register_And_ReRegister()
_initialState = _initialState
.MintAsset(context, _sellerAvatarAddress, 2 * RuneHelper.StakeRune)
.SetState(_sellerAvatarAddress, _sellerAvatarState.Serialize());
var action = new RegisterProduct
var action = new RegisterProduct2
{
AvatarAddress = _sellerAvatarAddress,
RegisterInfos = new List<IRegisterInfo>
Expand Down Expand Up @@ -570,7 +570,7 @@ public void Register_And_ReRegister()

var nextAvatarState = nextState.GetAvatarStateV2(_sellerAvatarAddress);
Assert.Empty(nextAvatarState.inventory.Items);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct.CostAp, nextAvatarState.actionPoint);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct2.CostAp, nextAvatarState.actionPoint);

var marketState = new MarketState(nextState.GetState(Addresses.Market));
Assert.Contains(_sellerAvatarAddress, marketState.AvatarAddresses);
Expand Down Expand Up @@ -693,7 +693,7 @@ public void Register_And_ReRegister()
});

var latestAvatarState = latestState.GetAvatarStateV2(_sellerAvatarAddress);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct.CostAp - ReRegisterProduct.CostAp, latestAvatarState.actionPoint);
Assert.Equal(_gameConfigState.ActionPointMax - RegisterProduct2.CostAp - ReRegisterProduct.CostAp, latestAvatarState.actionPoint);
var inventoryItem = Assert.Single(latestAvatarState.inventory.Items);
Assert.Equal(1, inventoryItem.count);
Assert.IsType<TradableMaterial>(inventoryItem.item);
Expand Down Expand Up @@ -960,7 +960,7 @@ public void HardFork()
},
};
//Cancel
var cancelAction = new CancelProductRegistration
var cancelAction = new CancelProductRegistration0
{
AvatarAddress = _sellerAvatarAddress,
ProductInfos = productInfos,
Expand Down Expand Up @@ -1057,7 +1057,7 @@ public void HardFork()
}));

//Buy
var buyAction = new BuyProduct
var buyAction = new BuyProduct2
{
AvatarAddress = _buyerAvatarAddress,
ProductInfos = productInfos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int petLevel
);

// Do combination without pet
var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = 0,
Expand Down Expand Up @@ -156,7 +156,7 @@ int petLevel
random
);

var petAction = new CombinationEquipment
var petAction = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = 1,
Expand Down
4 changes: 2 additions & 2 deletions .Lib9c.Tests/Action/Scenario/Pet/CommonTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void PetCannotBeUsedToTwoSlotsAtTheSameTime()
);

// Combination1
var action1 = new CombinationEquipment
var action1 = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = 0,
Expand All @@ -121,7 +121,7 @@ public void PetCannotBeUsedToTwoSlotsAtTheSameTime()
});

// Combination2: Raises error
var action2 = new CombinationEquipment
var action2 = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public void CraftEquipmentTest(
);

// Do combination
var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void RapidCombinationTest_Equipment(
);

// Do combination
var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = 0,
Expand All @@ -167,7 +167,7 @@ public void RapidCombinationTest_Equipment(
});

// Do rapid combination
var rapidAction = new RapidCombination
var rapidAction = new RapidCombination9
{
avatarAddress = _avatarAddr,
slotIndex = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void CombinationEquipmentTest(
);

// Do Combination
var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = 0,
Expand Down
4 changes: 2 additions & 2 deletions .Lib9c.Tests/Action/Scenario/RapidCombinationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ int expectedHourGlassCount

// Do combination action
var recipe = recipeList[i];
var action = new CombinationEquipment
var action = new CombinationEquipment16
{
avatarAddress = _avatarAddr,
slotIndex = i,
Expand All @@ -161,7 +161,7 @@ int expectedHourGlassCount
// Do RapidCombination
for (var i = 0; i < recipeList.Count; i++)
{
var action = new RapidCombination
var action = new RapidCombination9
{
avatarAddress = _avatarAddr,
slotIndex = i,
Expand Down
2 changes: 1 addition & 1 deletion .Lib9c.Tests/Action/Scenario/RuneScenarioTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void Craft_And_Equip()
var runeSlotStateAddress = RuneSlotState.DeriveAddress(avatarAddress, BattleType.Adventure);
Assert.Null(state.GetState(runeSlotStateAddress));

var has = new HackAndSlash
var has = new HackAndSlash21
{
StageId = 1,
AvatarAddress = avatarAddress,
Expand Down
2 changes: 1 addition & 1 deletion .Lib9c.Tests/Action/SellCancellationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ bool fromPreviousAction
Signer = _agentAddress,
});

var cancelProductRegistration = new CancelProductRegistration
var cancelProductRegistration = new CancelProductRegistration0
{
AvatarAddress = _avatarAddress,
ProductInfos = new List<IProductInfo>
Expand Down
2 changes: 1 addition & 1 deletion .Lib9c.Tests/Extensions/EquipmentExtensionsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private Equipment CreateEquipment(

if (!(subRecipeRow is null))
{
CombinationEquipment.AddAndUnlockOption(
CombinationEquipment16.AddAndUnlockOption(
new AgentState(new PrivateKey().ToAddress()),
null,
equipment,
Expand Down
2 changes: 1 addition & 1 deletion Lib9c.DevExtensions/Action/CreateOrReplaceAvatar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public IAccount Execute(
var recipe = recipeSheet.OrderedList!
.First(e => e.ResultEquipmentId == equipmentId);
var subRecipe = subRecipeSheetV2[recipe.SubRecipeIds[1]];
CombinationEquipment.AddAndUnlockOption(
CombinationEquipment16.AddAndUnlockOption(
agent,
null,
equipment,
Expand Down
Loading

0 comments on commit 825be37

Please sign in to comment.