Skip to content

MockUnitDays

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.


MockUnitDays

The MockUnitDays interface extends MockUnit<DayOfWeek>.

public interface MockUnitDays extends MockUnit<DayOfWeek> 

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

The easiest way to obtain a MockUnitDays is to call the days() method from MockNeat<T>.

Methods that are particular to MockUnitDays:

Method Description
display() This generates a MockUnitString from MockUnitDays by transforming the days of the week into localised strings.

display()

This method generates a MockUnitString from a MockUnitDays by transforming the days of the week into localised strings.

Examples of generating a String that represents a random day of the week-end in French:

String day = m.days()
              .after(FRIDAY)
              .display(TextStyle.FULL_STANDALONE, Locale.FRANCE)
              .val();
// Possible Output: "dimanche"

The method signatures are:

default MockUnitString display(TextStyle textStyle, Locale locale)

When we want to use the default locale:

default MockUnitString display(TextStyle textStyle)

When we want to use the default locale and the textStyle as FULL_STANDALONE:

default MockUnitString display()