All Downloads are FREE. Search and download functionalities are using the official Maven repository.

lucuma.itc.client.arb.ArbGmosFpu.scala Maven / Gradle / Ivy

There is a newer version: 0.22.3
Show newest version
// Copyright (c) 2016-2023 Association of Universities for Research in Astronomy, Inc. (AURA)
// For license information see LICENSE or https://opensource.org/licenses/BSD-3-Clause

package lucuma.itc.client
package arb

import lucuma.core.enums.GmosNorthFpu
import lucuma.core.enums.GmosSouthFpu
import lucuma.core.util.arb.ArbEnumerated
import org.scalacheck.*
import org.scalacheck.Arbitrary.arbitrary

trait ArbGmosFpu {

  import ArbEnumerated.given
  import ArbGmosCustomMask.given
  import GmosFpu.North
  import GmosFpu.South

  given Arbitrary[North] =
    Arbitrary {
      arbitrary[Either[GmosCustomMask, GmosNorthFpu]].map(North(_))
    }

  given Cogen[North] =
    Cogen[Either[GmosCustomMask, GmosNorthFpu]].contramap(_.fpu)

  given Arbitrary[South] =
    Arbitrary {
      arbitrary[Either[GmosCustomMask, GmosSouthFpu]].map(South(_))
    }

  given Cogen[South] =
    Cogen[Either[GmosCustomMask, GmosSouthFpu]].contramap(_.fpu)

}

object ArbGmosFpu extends ArbGmosFpu




© 2015 - 2024 Weber Informatics LLC | Privacy Policy