GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Add ShapeTests for Processing4 core module by aakritithecoder · Pull Request #1462 · processing/processing4 Conversation
|
|
This test ensures that PGraphics initializes width and height correctly when setSize() is called. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Moving forward please create an issue first as per our guidelines.
This code is a good start for creating a test suite for PGraphics thank you!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| public class ShapeTests { | ||
|
|
||
| @Test | ||
| public void testCanvasWidthAfterSetSize() { | ||
| // Create a PGraphics object and set its size | ||
| PGraphics pg = new PGraphics(); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is testing PGraphics please update the class name, and place this in the core/test/processing/core folder
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // Assert that the canvas height is 150 | ||
| assertEquals(150, pg.height); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this test of the pg height can be done in the other test function that tests width.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| pg.beginDraw(); | ||
| pg.rect(10, 10, 100, 50); // draw a rectangle | ||
| pg.endDraw(); | ||
|
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
this is not necessary since you are testing setSize
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hi @catilac ! I've addressed all the review feedback:
Also created an issue as per contributing guidelines: #1488 Please take a look! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Amazing, thank you! It looks good. I'll merge after running build! 🎊 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add unit tests for PGraphics setSize() in core module
There was an error while loading. Please reload this page.