Skip to content

Conversation

@Bari77
Copy link
Collaborator

@Bari77 Bari77 commented Jul 2, 2021

No description provided.

@codecov
Copy link

codecov bot commented Jul 2, 2021

Codecov Report

Merging #1476 (ac677b7) into master (8cdaed2) will increase coverage by 0.58%.
The diff coverage is 87.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1476      +/-   ##
==========================================
+ Coverage   35.43%   36.01%   +0.58%     
==========================================
  Files         240      244       +4     
  Lines        7372     7449      +77     
  Branches      561      568       +7     
==========================================
+ Hits         2612     2683      +71     
- Misses       4646     4652       +6     
  Partials      114      114              
Impacted Files Coverage Δ
...vices/NRunService/Handlers/ProbabilityUIHandler.cs 0.00% <0.00%> (ø)
....PacketHandlers/Command/CreateItemPacketHandler.cs 0.00% <ø> (ø)
...ject/Services/InventoryService/InventoryService.cs 65.68% <100.00%> (+2.89%) ⬆️
...ces/ItemGenerationService/ItemGenerationService.cs 76.78% <100.00%> (+6.67%) ⬆️
...radeService/SumUpgradeService/SumUpgradeService.cs 100.00% <100.00%> (ø)
...meObject/Services/UpgradeService/UpgradeService.cs 100.00% <100.00%> (ø)
...re.PacketHandlers/Upgrades/UpgradePacketHandler.cs 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8cdaed2...ac677b7. Read the comment docs.


InventoryItemInstance? RemoveItemAmountFromInventory(short amount, Guid id);

List<InventoryItemInstance?> RemoveItemAmountFromInventory(short amount, short vnum);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don’t need that if you have the load by vnum and amount

// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All those comment change make it harder to review

return retItem;
}

public List<InventoryItemInstance?> LoadByVNumAndAmount(short vnum, short amount)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if we need the amount getting all the item for a vnum is perfectly fine

amount -= item.ItemInstance!.Amount;
if (amount <= 0)
{
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return instead of break


public List<InventoryItemInstance?> RemoveItemAmountFromInventory(short amount, short vnum)
{
var result = new List<InventoryItemInstance?>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole thing is useless

case EquipmentType.SecondaryWeapon:
wearable.SetRarityPoint();
break;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like all those thing would be better in the item creation service not sure why I put it here. Can be moved to replace the other thing using polymorphism over switch will be better

var targetSlot = session.Character.InventoryService.LoadBySlotAndType((byte)upgradePacket.Slot2, (NoscorePocketType)upgradePacket.InventoryType);

await session.SendPacketsAsync(await _sumUpgradeService.SumItemInstanceAsync(session, sourceSlot, targetSlot));
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to log default


//TODO RemoveItemAmountFromInventory
[TestMethod]
public void RemoveItemAmountFromInventoryByGuidWithoutRemove()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming could be bettrr

Assert.IsTrue((destinationItem?.ItemInstance?.Amount == 999) && (destinationItem.Slot == 1));
}

//TODO RemoveItemAmountFromInventory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You remove todo but it was here for the other one not for yours 😂 still need to be tested. Moreover yours will disapear for the load one

}

[TestMethod]
public async Task Test_UpgradePacketSum1Async()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to test glove with boots, sum > 6, sum of different resistance

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 87.17949% with 10 lines in your changes missing coverage. Please review.

Project coverage is 36.01%. Comparing base (8cdaed2) to head (ac677b7).
Report is 371 commits behind head on master.

Files with missing lines Patch % Lines
...vices/NRunService/Handlers/ProbabilityUIHandler.cs 0.00% 10 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1476      +/-   ##
==========================================
+ Coverage   35.43%   36.01%   +0.58%     
==========================================
  Files         240      244       +4     
  Lines        7372     7449      +77     
  Branches      561      568       +7     
==========================================
+ Hits         2612     2683      +71     
- Misses       4646     4652       +6     
  Partials      114      114              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@erwan-joly erwan-joly closed this Mar 24, 2025
@erwan-joly erwan-joly reopened this Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants