use armature_core::{Container, Provider};
pub struct TestContainer {
container: Container,
}
impl TestContainer {
pub fn new() -> Self {
Self {
container: Container::new(),
}
}
pub fn register<T: Provider + Clone + 'static>(&self, provider: T) {
self.container.register(provider);
}
pub fn register_mock<T: Provider + Clone + 'static>(&self, mock: T) {
self.container.register(mock);
}
pub fn get<T: Provider + Clone + 'static>(&self) -> Option<T> {
None
}
pub fn clear(&mut self) {
self.container = Container::new();
}
pub fn inner(&self) -> &Container {
&self.container
}
}
impl Default for TestContainer {
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_container_creation() {
let _container = TestContainer::new();
}
}