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

Added Unit test #5303

Closed
wants to merge 7 commits into from
Closed

Added Unit test #5303

wants to merge 7 commits into from

Conversation

kdabiria
Copy link

Added three test cases testing the logic of the game.

@@ -21,7 21,7 @@
import mindustry.type.*;
import mindustry.world.*;
import org.junit.jupiter.api.*;

import mindustry.editor.*;
Copy link
Owner

Choose a reason for hiding this comment

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

What is this import used for?

@@ -136,6 136,40 @@ void spawnWaves(){
assertFalse(Groups.unit.isEmpty(), "No enemies spawned.");
}

@Test
void checkInitialItems() {
Copy link
Owner

Choose a reason for hiding this comment

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

I don't really see the purpose of this test. It may not always be the case that every map has 200 copper as a starting item, and some maps may not have any starting items at all. If I ever increase the starting copper amount to 300 copper, this test will break.

}

@Test
void TeamsStatusTest() {
Copy link
Owner

Choose a reason for hiding this comment

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

spurious

Suggested change
void TeamsStatusTest() {
void TeamsStatusTest(){

@@ -235,6 269,8 @@ void load(){
assertTrue(state.teams.playerCores().size > 0);
}


Copy link
Owner

Choose a reason for hiding this comment

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

unnecessary extra lines

@@ -268,6 304,8 @@ void liquidOutput(){
assertTrue(world.tile(2, 1).build.liquids.current() == Liquids.water);
}


Copy link
Owner

Choose a reason for hiding this comment

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

unnecessary extra lines

@kdabiria
Copy link
Author

kdabiria commented Jun 4, 2021

we fixed the issues you mentioned and send a new commit

@Anuken Anuken closed this Aug 3, 2024
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.

4 participants