diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-03 14:39:59 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-21 18:17:50 +0200 |
commit | b28ebe3007afbe3c581eb54df4c0baa26a9f508f (patch) | |
tree | 416105f66b2a2d0a541c66e8cd85b606343a58bb /src/di_container.rs | |
parent | b54dee1fb52f259de8b485d050d75c6956750b7f (diff) |
test: correct DI container bind tests
Diffstat (limited to 'src/di_container.rs')
-rw-r--r-- | src/di_container.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/di_container.rs b/src/di_container.rs index c33d339..239a2cb 100644 --- a/src/di_container.rs +++ b/src/di_container.rs @@ -482,7 +482,7 @@ mod tests } #[test] - fn can_bind_to() + fn can_bind_to() -> error_stack::Result<(), BindingBuilderError> { let mut di_container: DIContainer = DIContainer::new(); @@ -490,9 +490,11 @@ mod tests di_container .bind::<dyn subjects::IUserManager>() - .to::<subjects::UserManager>(); + .to::<subjects::UserManager>()?; assert_eq!(di_container.bindings.count(), 1); + + Ok(()) } #[test] @@ -513,7 +515,7 @@ mod tests #[test] #[cfg(feature = "factory")] - fn can_bind_to_factory() + fn can_bind_to_factory() -> error_stack::Result<(), BindingBuilderError> { type IUserManagerFactory = dyn crate::interfaces::factory::IFactory<(), dyn subjects::IUserManager>; @@ -527,9 +529,11 @@ mod tests TransientPtr::new(subjects::UserManager::new()); user_manager - }); + })?; assert_eq!(di_container.bindings.count(), 1); + + Ok(()) } #[test] |