private void SetupSubscriptionRepository() { var subscriptionRepository = MockRepository.GenerateMock <ISubscriptionRepository>(); subscriptionRepository.Stub(x => x.List()).Return(new List <Subscription>()); ObjectBuilder.Add(subscriptionRepository); }
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)); }
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()); }
protected virtual void SetupEndpointFactory() { EndpointFactory = EndpointFactoryConfigurator.New(x => { x.SetObjectBuilder(ObjectBuilder); x.RegisterTransport <TEndpoint>(); x.SetDefaultSerializer <XmlMessageSerializer>(); ConfigureEndpointFactory(x); }); ObjectBuilder.Add(EndpointFactory); }
protected virtual void SetupMessageSerializer() { ObjectBuilder.Add(new XmlMessageSerializer()); }
protected override void InitializeTests() { base.InitializeTests(); ObjectBuilder.Add <IAuthorizationProvider, MockAuthorizationProvider>(); ObjectBuilder.Add <IEnterpriseLibraryFacade, MockEnterpriseLibraryFacade>(); }
protected virtual void InitializeTests() { base.FixtureSetUp(); ObjectBuilder.Add <IAuthorizationProvider, MockAuthorizationProvider>(); ObjectBuilder.Add <IEnterpriseLibraryFacade, MockEnterpriseLibraryFacade>(); }