Inheritance: IServiceProvider
コード例 #1
0
        public void Setup()
        {
            MyCredentials = new Credentials() { UserName = "******", Password = "******" };
            ServiceProvider = new ServiceProvider(new PluginFinder());
            ServiceProvider.Add(new FauxMessageService("test 1"), new FauxMessageService("test2"));
            ServiceManager = new ServicesManager(ServiceProvider);

            Context();
            Because();
        }
コード例 #2
0
        public static void BootstrapStructureMap()
        {
            var serviceProviders = new ServiceProvider(new PluginFinder());
            serviceProviders.Add(new TwitterUtilities(new TestDataAccess()));

            // Initialize the static ObjectFactory container

            ObjectFactory.Initialize(x =>
            {
                x.ForRequestedType<IInteractionContext>().TheDefaultIsConcreteType<TestingInteractionContext>();
                x.ForRequestedType<IMessagingServiceManager>().TheDefaultIsConcreteType<ServicesManager>();
                x.ForRequestedType<IContactProvider>().TheDefaultIsConcreteType<ContactProvider>();
                x.ForRequestedType<IServiceProvider>().TheDefault.IsThis(serviceProviders);
            });
        }