Fix StoreTests EventBus usage (#38489)

Fix split off from #37349 to avoid needing to sync the content/engine PRs.
This commit is contained in:
Pieter-Jan Briers 2025-08-02 17:23:44 +02:00 committed by Vanessa
parent dce074ec24
commit aeea786127
1 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ public sealed class StoreTests
var buyMsg = new StoreBuyListingMessage(discountedListingItem.ID){Actor = human}; var buyMsg = new StoreBuyListingMessage(discountedListingItem.ID){Actor = human};
server.EntMan.EventBus.RaiseComponentEvent(pda, storeComponent, buyMsg); server.EntMan.EventBus.RaiseLocalEvent(pda, buyMsg);
var newBalance = storeComponent.Balance[UplinkSystem.TelecrystalCurrencyPrototype]; var newBalance = storeComponent.Balance[UplinkSystem.TelecrystalCurrencyPrototype];
Assert.That(newBalance.Value, Is.EqualTo((originalBalance - plainDiscountedCost).Value), "Expected to have balance reduced by discounted cost"); Assert.That(newBalance.Value, Is.EqualTo((originalBalance - plainDiscountedCost).Value), "Expected to have balance reduced by discounted cost");
@ -135,7 +135,7 @@ public sealed class StoreTests
Assert.That(costAfterBuy.Value, Is.EqualTo(prototypeCost.Value), "Expected cost after discount refund to be equal to prototype cost."); Assert.That(costAfterBuy.Value, Is.EqualTo(prototypeCost.Value), "Expected cost after discount refund to be equal to prototype cost.");
var refundMsg = new StoreRequestRefundMessage { Actor = human }; var refundMsg = new StoreRequestRefundMessage { Actor = human };
server.EntMan.EventBus.RaiseComponentEvent(pda, storeComponent, refundMsg); server.EntMan.EventBus.RaiseLocalEvent(pda, refundMsg);
// get refreshed item after refund re-generated items // get refreshed item after refund re-generated items
discountedListingItem = storeComponent.FullListingsCatalog.First(x => x.ID == itemId); discountedListingItem = storeComponent.FullListingsCatalog.First(x => x.ID == itemId);