Beispiel #1
0
        public void MethodInjectionTest()
        {
            // the object is created somewhere else
            OutlookEmailService_v2 outlookEmailService = new OutlookEmailService_v2();

            UserLogic_Method userLogic = new UserLogic_Method();

            // then the dependency is injected using the class method:
            userLogic.Register("email", "password", outlookEmailService);
        }
Beispiel #2
0
        public void SetterInjectionTest()
        {
            // the object is created somewhere else
            OutlookEmailService_v2 outlookEmailService = new OutlookEmailService_v2();

            // then the dependency is injected through the setter property:
            UserLogic_Setter userLogic = new UserLogic_Setter()
            {
                EmailService = outlookEmailService
            };
        }
Beispiel #3
0
 public UserLogic_Method()
 {
     _authService  = new GoogleOAuthService_v1();
     _emailService = new OutlookEmailService_v2();
 }