klirr 0.2.8

Zero-maintenance and smart FOSS generating beautiful invoices for services and expenses.
use crate::HasSample;

#[derive(clap::ValueEnum, Debug, Clone, PartialEq)]
pub enum TimeUnitInput {
    Hours,
    Days,
}

impl HasSample for TimeUnitInput {
    fn sample() -> Self {
        Self::Hours
    }

    fn sample_other() -> Self {
        Self::Days
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    type Sut = TimeUnitInput;

    #[test]
    fn equality() {
        assert_eq!(Sut::sample(), Sut::sample());
        assert_eq!(Sut::sample_other(), Sut::sample_other());
    }

    #[test]
    fn inequality() {
        assert_ne!(Sut::sample(), Sut::sample_other());
    }
}