private void SetupSubscriptionRepository()
        {
            var subscriptionRepository = MockRepository.GenerateMock <ISubscriptionRepository>();

            subscriptionRepository.Stub(x => x.List()).Return(new List <Subscription>());
            ObjectBuilder.Add(subscriptionRepository);
        }
示例#2
0
        public void Test_AddService()
        {
            ObjectBuilder.Add <ISimpleService, SimpleService>();
            ISimpleService simpleService = ObjectBuilder.Get <ISimpleService>();

            Assert.IsNotNull(simpleService);
            Assert.AreEqual(typeof(SimpleService), simpleService.GetType());
        }
        private void SetupSubscriptionService()
        {
            SubscriptionService = new LocalSubscriptionService();

            ObjectBuilder.Add(SubscriptionService);
            ObjectBuilder.Construct(() => new SubscriptionPublisher(SubscriptionService));
            ObjectBuilder.Construct(() => new SubscriptionConsumer(SubscriptionService, EndpointFactory));
        }
示例#4
0
        private void button15_Click(object sender, EventArgs e)
        {
            var ob = new ObjectBuilder();

            var o = new ObjectBuilder.DynamicResult(new Dictionary <string, object>());

            o["Bool"]   = Rndm.GetBoolean().ToString().ToUpper();
            o["Double"] = Rndm.GetDouble(-9999, 9999);
            o["Int"]    = Rndm.GetInt(-9999, 9999);
            o["String"] = Rndm.GetString(
                10, CharacterType.Symbol | CharacterType.UpperCase | CharacterType.LowerCase | CharacterType.Digit);

            ob.Add("alert", new Action <string>(s => MessageBox.Show(s)));
            ob.Add("Random", o);
            dynamic b = ob.Build();

            b.alert(b.Random.Bool.ToString());
        }
示例#5
0
        protected virtual void SetupEndpointFactory()
        {
            EndpointFactory = EndpointFactoryConfigurator.New(x =>
            {
                x.SetObjectBuilder(ObjectBuilder);
                x.RegisterTransport <TEndpoint>();
                x.SetDefaultSerializer <XmlMessageSerializer>();

                ConfigureEndpointFactory(x);
            });

            ObjectBuilder.Add(EndpointFactory);
        }
示例#6
0
 protected virtual void SetupMessageSerializer()
 {
     ObjectBuilder.Add(new XmlMessageSerializer());
 }
示例#7
0
 protected override void InitializeTests()
 {
     base.InitializeTests();
     ObjectBuilder.Add <IAuthorizationProvider, MockAuthorizationProvider>();
     ObjectBuilder.Add <IEnterpriseLibraryFacade, MockEnterpriseLibraryFacade>();
 }
示例#8
0
 protected virtual void InitializeTests()
 {
     base.FixtureSetUp();
     ObjectBuilder.Add <IAuthorizationProvider, MockAuthorizationProvider>();
     ObjectBuilder.Add <IEnterpriseLibraryFacade, MockEnterpriseLibraryFacade>();
 }