Ejemplo n.º 1
0
        public void WhenCreatingEvent_ThenInitializesProperties()
        {
            var sender = new object();
            var args   = new EventArgs();

            var @event = Event.Create(sender, args);

            Assert.Same(sender, @event.Sender);
            Assert.Same(args, @event.EventArgs);
        }
Ejemplo n.º 2
0
        public void WhenRetrievingVsService_ThenCanGetFromCompositionContainer()
        {
            var servicesExports = new ServicesExportProvider(GlobalServiceProvider.Instance);

            var container = new CompositionContainer(servicesExports);

            var shell = container.GetExportedValue <IVsUIShell>();

            Assert.NotNull(shell);

            var shell2 = GlobalServiceProvider.Instance.GetService <SVsUIShell, IVsUIShell>();

            Assert.Same(shell, shell2);
        }
Ejemplo n.º 3
0
        public void WhenCreatingBinding_ThenValuesAreSame()
        {
            var value   = new object();
            var binding = FixedBinding.Create(value);

            Assert.Same(value, binding.Value);
        }
Ejemplo n.º 4
0
            public void WhenInitializing_ThenExtensionIsSet()
            {
                var extension = new Mock <IInstalledExtension>().Object;

                var target = new InstalledToolkitInfo(extension, this.reader, this.resource);

                Assert.Same(extension, target.Extension);
            }
Ejemplo n.º 5
0
        public void WhenProductInstantiated_ThenRaisesInstantiatedEvent()
        {
            var           store        = new DslTestStore <ProductStateStoreDomainModel>();
            IProductState productState = null;

            store.TransactionManager.DoWithinTransaction(() =>
            {
                productState = store.ElementFactory.CreateElement <ProductState>();
            });

            IInstanceBase instantiated = null;
            IProduct      product      = null;

            productState.ElementInstantiated += (sender, args) => instantiated = args.Value;

            store.TransactionManager.DoWithinTransaction(() =>
            {
                product = productState.CreateProduct();
            });

            Assert.NotNull(instantiated);
            Assert.Same(product, instantiated);
        }