Ejemplo n.º 1
0
        public void FindAllServices_WithImpls_Should_Return_All()
        {
            var demoRegistry       = new DemoRegistry();
            var nbRegistryServices = demoRegistry.FindAllServices();

            foreach (var nbRegistryService in nbRegistryServices)
            {
                nbRegistryService.GetType().FullName.Log();
            }
            nbRegistryServices.Count.ShouldEqual(2);
        }
Ejemplo n.º 2
0
        public void Init_Once_Should_OK()
        {
            var demoRegistry = new DemoRegistry();
            var services     = new List <INbRegistryService <DemoRegistry> >();

            services.Add(new DemoRegistryService());
            services.Add(new DemoRegistryService2());

            demoRegistry.Init(services);

            demoRegistry.DemoItems.Count.ShouldEqual(2);
        }
Ejemplo n.º 3
0
        public void Init_Repeat_Should_ThrowEx()
        {
            var demoRegistry = new DemoRegistry();
            var services     = new List <INbRegistryService <DemoRegistry> >();

            services.Add(new DemoRegistryService());
            services.Add(new DemoRegistryService2());

            demoRegistry.Init(services);
            AssertHelper.ShouldThrows <InvalidOperationException>(() =>
            {
                demoRegistry.Init(services);
            });
        }