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

Add MekLocation tests #2331

Merged

Conversation

sixlettervariables
Copy link
Contributor

@sixlettervariables sixlettervariables commented Dec 28, 2020

This adds MekLocation unit tests and fixes tiny nits along the way.

TODO:

  • getXXXTime and getXXXDifficulty
  • needsFixing
  • updateConditionFromPart
  • fix
  • checkFixable
  • remove
  • checkScrappable
  • checkSalvagable
  • doMaintenanceDamage
  • getAllMods
  • getDetails
  • getDesc

@sixlettervariables sixlettervariables added the Tests Issues or Pull Requests related to the project tests label Dec 28, 2020
@sixlettervariables sixlettervariables added this to the 0.49-dev milestone Dec 28, 2020
@codecov
Copy link

codecov bot commented Dec 28, 2020

Codecov Report

Merging #2331 (bc44167) into master (e85f9bb) will increase coverage by 0.31%.
The diff coverage is 94.54%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2331      +/-   ##
============================================
+ Coverage     10.58%   10.89%   +0.31%     
- Complexity     3548     3727     +179     
============================================
  Files           670      670              
  Lines         94682    94679       -3     
  Branches      15860    15850      -10     
============================================
+ Hits          10020    10315     +295     
+ Misses        83295    83006     -289     
+ Partials       1367     1358       -9     
Impacted Files Coverage Δ Complexity Δ
MekHQ/src/mekhq/gui/RepairTab.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
MekHQ/src/mekhq/gui/dialog/AcquisitionsDialog.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
MekHQ/src/mekhq/campaign/parts/MekLocation.java 89.33% <95.37%> (+58.62%) 224.00 <71.00> (+152.00)
MekHQ/src/mekhq/campaign/Warehouse.java 64.60% <100.00%> (+0.31%) 41.00 <0.00> (ø)
.../mekhq/campaign/universe/FactionBorderTracker.java 68.87% <0.00%> (-2.05%) 35.00% <0.00%> (-1.00%)
...Q/src/mekhq/campaign/universe/RegionPerimeter.java 83.33% <0.00%> (-0.70%) 39.00% <0.00%> (-1.00%)
MekHQ/src/mekhq/campaign/universe/Planet.java 26.07% <0.00%> (-0.23%) 25.00% <0.00%> (ø%)
MekHQ/src/mekhq/campaign/work/WorkTime.java 66.00% <0.00%> (ø) 7.00% <0.00%> (+1.00%)
...ekHQ/src/mekhq/campaign/market/ContractMarket.java 58.69% <0.00%> (ø) 113.00% <0.00%> (ø%)
MekHQ/src/mekhq/campaign/mission/AtBContract.java 19.52% <0.00%> (+0.11%) 67.00% <0.00%> (+1.00%)
... and 5 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 e85f9bb...bc44167. Read the comment docs.

@sixlettervariables sixlettervariables force-pushed the add-more-part-unit-tests branch 2 times, most recently from 2d1d11f to ca6b6ac Compare December 30, 2020 21:02
@sixlettervariables sixlettervariables marked this pull request as ready for review January 3, 2021 15:55
@sixlettervariables
Copy link
Contributor Author

I've only got the small tests left to do, but otherwise all of the major functionality of MekLocation is now tested.

MekHQ/src/mekhq/campaign/parts/MekLocation.java Outdated Show resolved Hide resolved
MekHQ/src/mekhq/campaign/parts/MekLocation.java Outdated Show resolved Hide resolved
@Windchild292
Copy link
Contributor

@sixlettervariables just noticed this was unmerged. A few comments open and a merge conflict to fix, then this should be good to merge

@sixlettervariables
Copy link
Contributor Author

@Windchild292 addressed. There were some odd merge conflicts in un-changed parts of the code (Acquisition dialog), but I have those resolved.

@sixlettervariables sixlettervariables merged commit 99e21fa into MegaMek:master Apr 9, 2021
@sixlettervariables sixlettervariables deleted the add-more-part-unit-tests branch April 9, 2021 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tests Issues or Pull Requests related to the project tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

47.15 Can repair internal structure on an arm with a damaged shoulder actuator
2 participants