Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
U-lis committed Oct 7, 2024
1 parent c8d9619 commit ced981d
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 900,
MaxCp = 1000,
MinCp = 78811,
MaxCp = 118133,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
},
10, null,
21600, null,
};

// Random Icon
Expand All @@ -129,13 +129,13 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 900,
MaxCp = 1000,
MinCp = 196780,
MaxCp = 236104,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
ElementalType = ElementalType.Water,
},
},
10, null, 8,
21600, null, 17,
};

// Move to next group with additional cost
Expand All @@ -150,13 +150,13 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 900,
MaxCp = 1000,
MinCp = 78811,
MaxCp = 118133,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
},
10, null,
21600, null,
};
yield return new object?[]
{
Expand All @@ -169,13 +169,13 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 9000,
MaxCp = 10000,
MinCp = 127372,
MaxCp = 166695,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
},
12, null,
21600 * 2, null,
};
yield return new object?[]
{
Expand All @@ -188,13 +188,13 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 90000,
MaxCp = 100000,
MinCp = 231654,
MaxCp = 270976,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
},
15, null,
21600 * 8, null,
};

// Multiple slots
Expand All @@ -210,20 +210,20 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 900,
MaxCp = 1000,
MinCp = 78811,
MaxCp = 118133,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
new ()
{
MinCp = 800,
MaxCp = 900,
MinCp = 196780,
MaxCp = 236104,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
},
10, null,
21600, null,
};
yield return new object?[]
{
Expand All @@ -236,20 +236,20 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 900,
MaxCp = 1000,
MinCp = 78811,
MaxCp = 118133,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
new ()
{
MinCp = 800,
MaxCp = 900,
MinCp = 196780,
MaxCp = 236104,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
},
10, null,
21600, null,
};
yield return new object?[]
{
Expand All @@ -264,34 +264,34 @@ public CustomEquipmentCraftTest()
{
new ()
{
MinCp = 500,
MaxCp = 600,
MinCp = 39487,
MaxCp = 78810,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Water,
ElementalType = ElementalType.Normal,
},
new ()
{
MinCp = 300,
MaxCp = 400,
MinCp = 78811,
MaxCp = 118133,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Wind,
},
new ()
{
MinCp = 100,
MaxCp = 200,
MinCp = 39487,
MaxCp = 78810,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Water,
ElementalType = ElementalType.Wind,
},
new ()
{
MinCp = 900,
MaxCp = 1000,
MinCp = 39487,
MaxCp = 78810,
ItemSubType = ItemSubType.Weapon,
ElementalType = ElementalType.Normal,
ElementalType = ElementalType.Fire,
},
},
10, null, 4,
21600, null, 22,
};
}

Expand Down Expand Up @@ -321,7 +321,7 @@ public CustomEquipmentCraftTest()
{
new List<CustomCraftData>
{
new () { RecipeId = 1, SlotIndex = 0, IconId = 10131001, },
new () { RecipeId = 1, SlotIndex = 0, IconId = 10140000, },
},
true, 0, false, new List<TestResult>(), 0, typeof(NotEnoughRelationshipException),
};
Expand Down
12 changes: 6 additions & 6 deletions .Lib9c.Tests/Action/GrindingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,11 @@ public void CalculateMaterialReward(int[] equipmentIds, Dictionary<int, int> exp
);

Assert.Equal(expected.Count, actual.Count);
foreach (var (material, count) in actual)
foreach (var (material, actualCount) in actual)
{
if (expected.TryGetValue(material.Id, out var actualCount))
if (expected.TryGetValue(material.Id, out var expectedCount))
{
Assert.Equal(count, actualCount);
Assert.Equal(expectedCount, actualCount);
}
else
{
Expand Down Expand Up @@ -422,9 +422,9 @@ private class CalculateMaterialRewardData : IEnumerable<object[]>
new[] { 10750008, 10760000, 20160000, 20160003 },
new Dictionary<int, int>
{
{ 306085, 15 },
{ 600401, 35 },
{ 600402, 21 },
{ 306085, 15 }, // 5 + 10 + 0 + 0
{ 600401, 12 }, // 0 + 0 + 2 + 10
{ 600402, 23 }, // 0 + 0 + 3 + 20
},
},
new object[]
Expand Down
2 changes: 0 additions & 2 deletions Lib9c/Helper/CustomCraftHelper.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#nullable enable
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Numerics;
using BTAI;
using Libplanet.Action;
using Nekoyume.Battle;
using Nekoyume.Model.Item;
Expand Down

0 comments on commit ced981d

Please sign in to comment.