2024-12-23 00:20:59 -03:00
|
|
|
pub mod errors;
|
2024-12-22 20:56:52 -03:00
|
|
|
pub mod models;
|
|
|
|
pub mod traits;
|
2024-12-23 00:20:59 -03:00
|
|
|
pub use errors::{Error, ErrorKind, Result};
|
|
|
|
|
2024-12-22 20:56:52 -03:00
|
|
|
#[cfg(test)]
|
|
|
|
mod tests {
|
|
|
|
use super::*;
|
2024-12-24 21:13:47 -03:00
|
|
|
use crate::models::{Customer, CustomerStatus, SubscriptionTier};
|
2024-12-22 20:56:52 -03:00
|
|
|
use rstest::*;
|
|
|
|
|
2024-12-24 21:13:47 -03:00
|
|
|
#[fixture]
|
2024-12-22 20:56:52 -03:00
|
|
|
fn customer() -> Customer {
|
|
|
|
Customer::new(
|
|
|
|
"Test Corp".to_string(),
|
2024-12-24 21:13:47 -03:00
|
|
|
"test@example.com".to_string(),
|
|
|
|
SubscriptionTier::Enterprise,
|
2024-12-22 20:56:52 -03:00
|
|
|
10,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rstest]
|
|
|
|
fn test_customer_fixture(customer: Customer) {
|
|
|
|
assert_eq!(customer.name, "Test Corp");
|
2024-12-24 21:13:47 -03:00
|
|
|
assert_eq!(customer.email, "test@example.com");
|
|
|
|
|
2024-12-22 20:56:52 -03:00
|
|
|
assert_eq!(customer.max_instances, 10);
|
2024-12-24 21:13:47 -03:00
|
|
|
|
2024-12-22 20:56:52 -03:00
|
|
|
}
|
2024-12-24 21:13:47 -03:00
|
|
|
}
|