use std::{sync::Arc, time::Duration};
use rstest::fixture;
use crate::{
client::pool::{core::PoolCore, test_support::test_pool_slot},
serializer::BincodeSerializer,
};
pub(crate) type TestCore = PoolCore<BincodeSerializer, (), ()>;
pub(crate) fn test_core(slot_count: usize) -> Arc<TestCore> {
let slots = (0..slot_count)
.map(|_| test_pool_slot(1, Duration::from_secs(30)))
.collect::<Vec<_>>()
.into_boxed_slice();
Arc::new(TestCore::new(slots))
}
#[fixture]
pub(crate) fn four_slot_core() -> Arc<TestCore> {
let slot_count = 4;
test_core(slot_count)
}
#[fixture]
pub(crate) fn two_slot_core() -> Arc<TestCore> {
let slot_count = 2;
test_core(slot_count)
}
#[fixture]
pub(crate) fn one_slot_core() -> Arc<TestCore> {
let slot_count = 1;
test_core(slot_count)
}