Coder Social home page Coder Social logo

hello-java's Introduction

Build Status codecov

assumption

moreThanAMonthApart A month is from some day to the same day in the following month, regardless of the number of days. So, Jan 3rd to Feb 3rd is exactly one month. Jan 3rd to Feb 4th is more than a month.

restriction

Cannot use standard date/time classes.

pre-condition

java -version 
openjdk version "1.8.0_265"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_265-b01)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.265-b01, mixed mode)

run test

./gradlew clean test 

expected result

 ./gradlew clean test
> Task :compileJava UP-TO-DATE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :compileTestJava UP-TO-DATE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test
AppTest > testMoreThanAMonthApartWithCross31And30Day PASSED
AppTest > testMoreThanAMonthApartWithSuccessInLeapYear29Feb PASSED
AppTest > testIsLaterOrEqualThanInSameMonthOneDayBeforeDate PASSED
AppTest > testMoreThanAMonthApartBuildInWithCrossYear PASSED
AppTest > testMoreThanAMonthApartBetweenJan30AndFeb PASSED
AppTest > testMoreThanAMonthApartBuildInWithDifferenceBCYear PASSED
AppTest > testGetAMonthLaterFEB PASSED
AppTest > testMoreThanAMonthApartBetweenJulAndAug PASSED
AppTest > testIsValidDayOfMonth35May PASSED
AppTest > testMoreThanAMonthApartBuildInWithInvalidDayOfMonth PASSED
AppTest > testIsValidDayOfMonthSuccess PASSED
AppTest > testMoreThanAMonthApartBuildInBetweenFebAndMar PASSED
AppTest > testMoreThanAMonthApartBuildInWithDifferenceYear PASSED
AppTest > testMoreThanAMonthApartBetweenFebAndMar PASSED
AppTest > testMoreThanAMonthApartBetweenJan31AndFeb PASSED
AppTest > testMoreThanAMonthApartWithDifferenceYear PASSED
AppTest > testIsLaterOrEqualThanInSameMonthOneDayAfterDate PASSED
AppTest > testIsValidDayOfMonth29FebInNonLeapYear PASSED
AppTest > testMoreThanAMonthApartBuildInWithInvalidMonth PASSED
AppTest > testMoreThanAMonthApartWithInvalidMonth PASSED
AppTest > testMoreThanAMonthApartBetweenOctAndNov PASSED
AppTest > testMoreThanAMonthApartWithInvalidDayOfMonth PASSED
AppTest > testGetAMonthLaterFromJAN2FEBInLeapYear PASSED
AppTest > testMoreThanAMonthApartBuildInWithInvalidNegativeDayOfMonth PASSED
AppTest > testMoreThanAMonthApartBetweenMayAndJul PASSED
AppTest > testMoreThanAMonthApartWithAIsLatestButLessThanAMonthGap PASSED
AppTest > testMoreThanAMonthApartWithInvalidNegativeDayOfMonth PASSED
AppTest > testIsLaterOrEqualThanOneMonthBeforeDate PASSED
AppTest > testMoreThanAMonthApartBetweenJan29AndFeb PASSED
AppTest > testGetAMonthLater PASSED
AppTest > testMoreThanAMonthApartWithInvalidDay29FebInNonLeapYear PASSED
AppTest > testGetAMonthLaterCrossYear PASSED
AppTest > testGetAMonthLaterFromMAYToJUN PASSED
AppTest > testGetAMonthLaterFromJAN2FEBInNonLeapYear PASSED
AppTest > testMoreThanAMonthApartWithSameDate PASSED
AppTest > testValidDateFailWith13Month PASSED
AppTest > testIsValidDayOfZeroMonth PASSED
AppTest > testMoreThanAMonthApartBuildInWithCross31And30Day PASSED
AppTest > testIsValidDayOfMonth29FebInLeapYear PASSED
AppTest > testMoreThanAMonthApartWithAIsLatest PASSED
AppTest > testIsLaterOrEqualThanCrossYear PASSED
AppTest > testMoreThanAMonthApartWithDifferenceBCYear PASSED
AppTest > testMoreThanAMonthApartBuildInWithAIsLatest PASSED
AppTest > testMoreThanAMonthApartBuildInWithSameDate PASSED
AppTest > testMoreThanAMonthApartBuildInCrossFEB28 PASSED
AppTest > testMoreThanAMonthApartCrossFEB28 PASSED
AppTest > testIsLaterOrEqualThanInEqualDate PASSED
AppTest > testMoreThanAMonthApartBetweenAugAndSep PASSED
AppTest > testMoreThanAMonthApartWithCrossYear PASSED
AppTest > testMoreThanAMonthApartBetweenDecAndJanCrossYear PASSED
AppTest > testMoreThanAMonthApartBuildInWithAIsLatestButLessThanAMonthGap PASSED
> Task :jacocoTestReport
BUILD SUCCESSFUL in 6s
5 actionable tasks: 5 executed

improvement ?

ping me via [email protected]

reference

  1. https://www.geeksforgeeks.org/calendar-compareto-method-in-java-with-examples/
  2. https://stackoverflow.com/questions/9356543/logging-while-testing-through-gradle

hello-java's People

Contributors

alphawong avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.