Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fix the implementation of isLeapYear, based on the tests that still failed in Java please -BGS SimpleClass java SimpleClass Testjava 1 package labdUnit; module-info.java 3

image text in transcribed

image text in transcribed

image text in transcribed

Fix the implementation of isLeapYear, based on the tests that still failed in Java please

-BGS SimpleClass java SimpleClass Testjava 1 package labdUnit; module-info.java 3 4 6 . Simple class to demonstrate automated testing with unit Jupiter (Junit 5). author Bowen Smith 9 public class SimpleClass { Determines whether a given year is a leap year.

"parany year! return true if year is a leap year and false otherwise. throws IllegalArgumentException if year is not positive. public static boolean is LeapYear(int year) return year 4 EclipseWork - 1410 LABS/test/labUnit/SimpleClass Testjava - Eclipse IDE File Edit Source Refactor Navigate Search Project Run Window Help PRO- 990- Package Explorer du Unit - SimpleClassjava SimpleClass Testjava x D module-info java 1. B e package labunit; Finished after 0.071 seconds 3e inport static org.junit.jupiter.api. Assertions. Runs 6/6 Error 0 Failures 3 5 import org.junit.jupiter.api. Test; 7 class SimpleClass Test SimpleClass Test Runner Unit) 10.0195) di isleap Year_YearlsZero_ThrowsilegalArgumentException (0.009 s) isLeap Year YearNot Multiple014 False 001001 Od leap Year Yearle Multiple 100 .Not1400 Fale (0.00 ) isLeap Year_YearlsNegative ThrowslilegalArgumentException 10.002) Leap Year_Years Multiple14But Not 100 True (0.001) isleapYear_Yearls Multiple400 True (0.004) Test void isLeapYear YearIshultipleofButNotof109 True assertTrue (Simpleclass. isLeap Year(2024)); Test void isLeapYear_Year Is Multipleof100But Notof4ee_False() { assertFalse(SimpleClass. isteapYear(1900)); vold IslapYear Year ultipleOf 400 True) { assert True (Simpleclass. steap Year (2000), "Years that can be exactly void isLeapYear Year Is Not Multipleof4 False() { assertFalse(Simpleclass.isleap Year(2021)): void isteapYear Yearszero Throwse largumentException() { assert Throws (IllegalArgumentException.class()-> SimpleClass.isLeap void isteapYear Years Negative Throws IllegalArgumentException() { assert Throws (IllegalArgumentException.class, () -> Simpleclass.islega Fallace BA org opentest) Aretiofailedon Expected java.lang IllegalArgumentException to be at Lab u nt.SimpleClasslestiseap Year YeartsZero Throwing ArgumentExcept java baseljaval ArayLittorach (ArrayList 1500 javabastati Artyforachraytist :1540) E Declaration ted. Splet n a Comele bijv.exe plan 2200 1126 10 PM SimpleClass.java SimpleClass Test.javax module-info.java 1 package labdUnit; 3 import static org junit.jupiter.api. Assertions."; 5 import org.junit.jupiter.api. Test; 7 class SimpleClass Test Test void isLeapYear_Year IsMultipleOf ButNotof 100 True() { assert True (Simpleclass.isLeapYear(2024)); 12 13 148 15 16 17 Test void isteapYear_Year isMultipleof 100ButNotof 400 False) { assertFalse(SimpleClass. isleap Year(1900)); 190 Test void isLeapYear_Year isMultipleoffee_True assert True (SimpleClass. isleap Year (2000), "Years that can be exactly divided by 400, should be leap years."): 21 24 Test void isLeapYear Year Is Not MultipleOf 4 False) GssertFalse (SimpleClass. isleapYear (2021)); 26 27 299 30 @Test void isteapYear YeartsZero Throws lessArgumentException() { assert Throws(IllegalArgumentException.class, () -> SimpleClass.isleap Year(e) ); Test void isLeapYear YearIsNegative Throws IllegalArgumentException() { assert Throws (IllegalArgumentException.class, () -> SimpleClass. isteapYear(-100); })

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago

Question

understand the meaning of the terms discipline and grievance

Answered: 1 week ago