diff options
author | HampusM <hampus@hampusmat.com> | 2022-10-03 19:41:58 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-10-03 19:41:58 +0200 |
commit | 03d3898a05592eb83b7a16609dba46d0b293790e (patch) | |
tree | c0e28a8f872a6e1714dc2207c5f3063bcfa24afc /src | |
parent | 846720a4168fcd6de54a4c59152bac785c866a18 (diff) |
test: fix the can bind to factory unit tests
Diffstat (limited to 'src')
-rw-r--r-- | src/di_container.rs | 14 |
1 files 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<dyn Error>> { - 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<dyn Error>> { - 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(); |