Exemplo n.º 1
0
        static void Main(string[] args)
        {
            // **** Registering
            var container = new WindsorContainer();

            container.Register(Component.For <DbContext>().ImplementedBy <DonationContext>());
            container.Register(Component.For <IRepository>().ImplementedBy <GiftAidRepository>());
            container.Register(Component.For <IDecimalHelper>().ImplementedBy <DecimalHelper>());
            container.Register(Component.For <IDonor>().ImplementedBy <Donor>());
            container.Register(Component.For <ISiteAdministrator>().ImplementedBy <SiteAdministrator>());
            container.Register(Component.For <IEventPromoterSwimming>().ImplementedBy <EventPromoterSwimming>());
            container.Register(Component.For <IEventPromoterRunning>().ImplementedBy <EventPromoterRunning>());
            container.Register(Component.For <IEventPromoterOther>().ImplementedBy <EventPromoterOther>());

            // **** Resolving

            _Repository            = container.Resolve <IRepository>();
            _DecimalHelper         = container.Resolve <IDecimalHelper>();
            _Doner                 = container.Resolve <IDonor>();
            _SiteAdministrator     = container.Resolve <ISiteAdministrator>();
            _EventPromoterRunning  = container.Resolve <IEventPromoterRunning>();
            _EventPromoterSwimming = container.Resolve <IEventPromoterSwimming>();
            _EventPromoterOther    = container.Resolve <IEventPromoterOther>();

            DefineRole();
        }
Exemplo n.º 2
0
 public void TearDown()
 {
     _Donor = null;
     _EventPromoterOther = null;
 }
Exemplo n.º 3
0
 public void Setup()
 {
     _Donor = new Mock <IDonor>();
     _EventPromoterOther = new EventPromoterOther(_Donor.Object);
 }