Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    oybek
    @oybek
    Hello!

    I have this code:

      val helloGenerator = random[Hello]
      case class Hello(a: LocalDate)
    
      implicit val arbitraryLocalDate: Arbitrary[LocalDate] = Arbitrary {
        for {
          year  <- Gen.choose(1900, 2020)
          month <- Gen.choose(1, 12)
          day   <- Gen.choose(1, 28)
        } yield LocalDate.of(year, month, day)
      }

    I wrote instance of Arbitrary for LocalDate
    Getting runtime exception

    An exception or error caused a run to abort: Could not generate a random value for Donors.this.Hello.
    Please, make use that the Arbitrary instance for type Donors.this.Hello is not too restrictive 
    com.danielasfregola.randomdatagenerator.magnolia.RandomDataException: Could not generate a random value for Donors.this.Hello.
    Please, make use that the Arbitrary instance for type Donors.this.Hello is not too restrictive
    Daniela Sfregola
    @DanielaSfregola
    Ho @oybek, what happens if you write implicitly[Arbitrary[LocalDate]]?