Пример #1
0
        static void Main()
        {
            try
            {
                ConfigureDatabase();

                IWindsorContainer container = new WindsorContainer();
                container.AddComponent("logger", typeof(ILogger), typeof(ConsoleLoggerImpl));
                container.AddComponent("auditor", typeof(IAuditor), typeof(AuditorImpl));
                container.AddComponent("authorization", typeof(IAuthorization), typeof(AuthorizationImpl));
                container.AddComponent("repository", typeof(IRepository), typeof(RepositoryImpl));
                container.AddComponent("customer_finder", typeof(ICustomerFinder), typeof(CustomerFinderImpl));

                ICustomerFinder        customerFinder = container.Resolve <ICustomerFinder>();
                ICollection <Customer> customers      = customerFinder.FindCustomersByName("oren");
                foreach (Customer customer in customers)
                {
                    Console.WriteLine("Got customer: " + customer.Name);
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e);
            }
        }
Пример #2
0
 public NewsletterService(ICustomerFinder customerFinder)
 {
     this.customerFinder = customerFinder;
 }
 public CustomerFinderSorter(ICustomerFinder customerFinder)
 {
     this.customerFinder = customerFinder;
 }
Пример #4
0
 public NewsletterService(ICustomerFinder customerFinder)
 {
     this.customerFinder = customerFinder;
 }
        public void SetUp()
        {
            this.customerFinder = A.Fake<ICustomerFinder>();

            this.testee = new NewsletterService(this.customerFinder);
        }
Пример #6
0
 public Startup(IConfigurationReader configurationReader, ICustomerFinder customerFinder, IInviter inviter)
 {
     this.configurationReader = configurationReader;
     this.customerFinder      = customerFinder;
     this.inviter             = inviter;
 }
        public void SetUp()
        {
            this.customerFinder = A.Fake <ICustomerFinder>();

            this.testee = new NewsletterService(this.customerFinder);
        }
Пример #8
0
 public GetCustomerForUserQueryHandler(ICustomerFinder customerFinder)
 {
     _customerFinder = customerFinder;
 }