From 03d3898a05592eb83b7a16609dba46d0b293790e Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 3 Oct 2022 19:41:58 +0200 Subject: test: fix the can bind to factory unit tests --- src/di_container.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/di_container.rs b/src/di_container.rs index 068a798..b23cdb1 100644 --- a/src/di_container.rs +++ b/src/di_container.rs @@ -845,8 +845,11 @@ mod tests #[cfg(feature = "factory")] fn can_bind_to_factory() -> Result<(), Box> { - type IUserManagerFactory = - dyn crate::interfaces::factory::IFactory<(), dyn subjects::IUserManager>; + use crate as syrette; + use crate::factory; + + #[factory] + type IUserManagerFactory = dyn Fn() -> dyn subjects::IUserManager; let mut di_container = DIContainer::new(); @@ -872,8 +875,11 @@ mod tests #[cfg(feature = "factory")] fn can_bind_to_factory_when_named() -> Result<(), Box> { - type IUserManagerFactory = - dyn crate::interfaces::factory::IFactory<(), dyn subjects::IUserManager>; + use crate as syrette; + use crate::factory; + + #[factory] + type IUserManagerFactory = dyn Fn() -> dyn subjects::IUserManager; let mut di_container = DIContainer::new(); -- cgit v1.2.3-18-g5258