aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-10-03 19:41:58 +0200
committerHampusM <hampus@hampusmat.com>2022-10-03 19:41:58 +0200
commit03d3898a05592eb83b7a16609dba46d0b293790e (patch)
treec0e28a8f872a6e1714dc2207c5f3063bcfa24afc /src
parent846720a4168fcd6de54a4c59152bac785c866a18 (diff)
test: fix the can bind to factory unit tests
Diffstat (limited to 'src')
-rw-r--r--src/di_container.rs14
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();