Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Add MTE tests for ItemCommands #12

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

skaldarnar
Copy link
Contributor

@skaldarnar skaldarnar commented May 24, 2020

Split out from #10

character.upsertComponent(InventoryComponent.class, maybeInventory -> maybeInventory.orElse(new InventoryComponent(40)));

final BlockItemFactory factory = new BlockItemFactory(entityManager);
final EntityRef blockItem = factory.newInstance(blockManager.getBlockFamily(URI_DIRT), amount);
Copy link
Member

Choose a reason for hiding this comment

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

I think you're doing this in #12 as well. We could consider to create a TestUtils class 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this not needed here... at least not as of now... will be tricky enough to figure out what classifies the added block to be "correct"

//TODO: I don't know what to pass in there, whether it needs to be the player, character, or something else
itemCommands.give(player, URI_DIRT, amount, null);

final List<EntityRef> filledSlots =
Copy link
Member

Choose a reason for hiding this comment

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

see comment above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This may be moved to InventoryUtils::filledSlots(InventoryComponent) or InventoryUtils::getItemsFrom(InventoryComponent).

@skaldarnar
Copy link
Contributor Author

❌ 39 tests completed, 3 failed, 8 skipped

@soloturn
Copy link
Contributor

this can be closed, @jdrueckert ?

@jdrueckert
Copy link
Member

this can be closed, @jdrueckert ?

why?

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.

None yet

3 participants