Complete the code to assert that the method returns true.
assertTrue([1]());The method isCodeQualityPassed() returns a boolean indicating if the code quality gate passed. Using assertTrue checks this condition.
Complete the code to fail the test if the code quality gate is not met.
if (![1]()) { fail("Code quality gate failed"); }
The method isCodeQualityPassed() returns true if the quality gate passes. Negating it with ! means the test fails if the gate is not passed.
Fix the error in the assertion to check that the quality gate score is above 80.
assertTrue(qualityGate.getScore() [1] 80);
The test should pass only if the quality gate score is greater than 80, so the correct operator is >.
Fill both blanks to create a test that asserts the quality gate status is 'PASSED' and the score is at least 90.
assertEquals("[1]", qualityGate.getStatus()); assertTrue(qualityGate.getScore() [2] 90);
The status should be exactly 'PASSED' and the score should be greater than or equal to 90 to pass the test.
Fill all three blanks to create a test that checks the quality gate status is 'PASSED', the score is above 85, and the error count is zero.
assertEquals("[1]", qualityGate.getStatus()); assertTrue(qualityGate.getScore() [2] 85); assertEquals([3], qualityGate.getErrorCount());
The test verifies the status is 'PASSED', the score is greater than 85, and there are no errors (error count is 0).