Skip to content

MockUnitLocalDate

Andrei Ciobanu edited this page Jan 10, 2019 · 4 revisions

Important Note: The library the documentation has moved to www.mockneat.com. The information found on this wiki is quite outdated. Please check the new site.


MockUnitLocalDate

The MockUnitLocalDate interface extends MockUnit<LocalDate>.

public interface `MockUnitLocalDate` extends MockUnit<LocaleDate>

This means that it "inherits" all the methods from MockUnit<LocaleDate>

The easiest way to obtain a MockUnitLocalDate is to call the localDates() method from MockNeat.

Methods that are particular to MockUnitInt:

Method Description
toUtilDate() Generates a MockUnit<java.util.Date> from a MockUnitLocalDate.

toUtilDate()

Translates the existing MockUnitLocalDate into a MockUnit<java.util.Date>.

Example:

Date date = mock.localDates()
                  .between(
                     of(2000, 10, 10),
                     of(2020, 10, 10)
                  )
                  .toUtilDate()
                  .val();