From 7bed48c852a741df5a14359916faf21d90d39814 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 31 Aug 2023 19:19:06 +0200 Subject: refactor: pass around BindingOptions instead of name --- src/test_utils.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/test_utils.rs') diff --git a/src/test_utils.rs b/src/test_utils.rs index 1e0e04d..a304a71 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -289,6 +289,7 @@ pub mod mocks use crate::di_container::blocking::binding::builder::BindingBuilder; use crate::di_container::blocking::details::DIContainerInternals; use crate::di_container::blocking::{BindingOptionsWithLt, IDIContainer}; + use crate::di_container::BindingOptions; use crate::errors::di_container::DIContainerError; use crate::provider::blocking::IProvider; use crate::ptr::SomePtr; @@ -328,21 +329,24 @@ pub mod mocks impl DIContainerInternals for DIContainer { - fn has_binding(self: &Rc, name: Option<&'static str>) -> bool + fn has_binding( + self: &Rc, + binding_options: BindingOptionsWithLt + ) -> bool where Interface: ?Sized + 'static; #[doc(hidden)] fn set_binding( self: &Rc, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, provider: Box>, ) where Interface: 'static + ?Sized; fn remove_binding( self: &Rc, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, ) -> Option>> where Interface: 'static + ?Sized; @@ -406,21 +410,21 @@ pub mod mocks { async fn has_binding( self: &Arc, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, ) -> bool where Interface: ?Sized + 'static; async fn set_binding( self: &Arc, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, provider: Box>, ) where Interface: 'static + ?Sized; async fn remove_binding( self: &Arc, - name: Option<&'static str>, + binding_options: BindingOptions<'static>, ) -> Option>> where Interface: 'static + ?Sized; -- cgit v1.2.3-18-g5258