OneLiteFeatherNET / Microtus

Up to date Minestom fork caring about community, code quality & stability
https://wiki.microtus.dev
Other
9 stars 3 forks source link

Enhance instance and player handling in the test module #72

Closed theEvilReaper closed 2 months ago

theEvilReaper commented 2 months ago

Proposed changes

The Minestom testing module allows for the creation of tests that interact with specific parts of the server. However, its handling has some issues. For example, when you unregister an instance with players in it an exception is thrown. The players are not unregistered by default. Additionally, when creating a player, a position is required even in cases where it is unnecessary; a default value should be used instead.

This pull request aims to achieve the following goals:

Add a player creation method that does not require a position, using a default value instead. Modify the instance unregistration method to include an option to remove all players from the instance, preventing an exception from being thrown.

Note: This pull request does not break existing tests. The new methods are additions that do not change existing behavior. Users can choose to remove players from an instance or specify a specific position when creating a player.

Types of changes

What types of changes does your code introduce to this project? Put an x in the boxes that apply

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

sonarcloud[bot] commented 2 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud