Exemple #1
0
        public void WhenResolvingUri_ThenNotFeatureRuntimeVsix()
        {
            var service = VsIdeTestHostContext.ServiceProvider.GetService <IUriReferenceService>();

            Assert.NotNull(service);
            var uri = new Uri("vsix://FeatureExtensionRuntime");

            var installed = service.ResolveUri <IInstalledExtension>(uri);
            var extension = service.ResolveUri <IExtension>(uri);

            Assert.Null(installed);
            Assert.Null(extension);
        }
        public void WhenPackIsNotItem_ResolveNull()
        {
            var resolver = new PackUriProvider();

            resolver.Solution = this.solution;

            Assert.Null(resolver.ResolveUri(new Uri("pack://application:,,,/referencedproject;component/foo.ico")));
        }
        public void WhenCreatingNewPropertyWithoutDefinitionId_ThenInfoTurnsNull()
        {
            using (var tx = this.store.TransactionManager.BeginTransaction())
            {
                var target = this.store.ElementFactory.CreateElement <Property>();
                tx.Commit();

                Assert.Null(target.Info);
            }
        }
            public void WhenInitializingAndIconIsNull_ThenIconPathIsNull()
            {
                var extension = new Mock <IInstalledExtension>();

                extension.Setup(ext => ext.InstallPath).Returns(@"Z:\InstallDir");
                extension.Setup(ext => ext.Header.Icon).Returns((string)null);

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

                Assert.Null(target.PatternIconPath);
            }
        public void WhenGettingOutputAssemblyButNoBuild_ThenCanOptOutOfBuild()
        {
            base.OpenSolution("SampleSolution\\SampleSolution.sln");

            var explorer = base.ServiceLocator.GetInstance <ISolutionExplorer>();
            var lib      = explorer.Solution.Traverse().OfType <IProjectNode>()
                           .FirstOrDefault(node => node.DisplayName == "ClassLibrary");
            var outDir = Path.Combine(lib.Properties.MSBuildProjectDirectory,
                                      lib.Adapt().AsMsBuildProject().AllEvaluatedProperties
                                      .Where(p => p.Name == "IntermediateOutputPath")
                                      .Select(p => lib.Adapt().AsMsBuildProject().ExpandString(p.UnevaluatedValue))
                                      .First());

            if (Directory.Exists(outDir))
            {
                Directory.Delete(outDir, true);
            }

            var asm = lib.GetOutputAssembly(false).Result;

            Assert.Null(asm);
        }
        public void WhenProductInstantiatedWhileSerializing_ThenDoesNotRaiseInstantiatedEvent()
        {
            var store = new DslTestStore <ProductStateStoreDomainModel>();

            store.Store.PropertyBag[ProductState.IsSerializingKey] = true;
            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.Null(instantiated);
        }
Exemple #7
0
 public void WhenGettingServiceAndNotFound_ThenReturnsNull()
 {
     Assert.Null(this.target.GetService(typeof(object)));
 }
 public void WhenUriIsNotItem_ReturnsNull()
 {
     Assert.Null(this.service.ResolveUri <ResourcePack>(new Uri("pack://application:,,,/TestProviders;component/foo.bmp")));
 }
Exemple #9
0
 public void WhenConvertingFromInValidValue_ThenReturnsNull()
 {
     Assert.Null(this.converter.ConvertFrom(this.context, CultureInfo.InvariantCulture, "sdsd"));
 }
            public virtual void when_I_get_a_non_existent_property_then_returns_null_with_dynamic_property_syntax()
            {
                string name = Properties.Foo;

                Assert.Null(name);
            }
Exemple #11
0
 public void WhenConstructed_ThenTargetIsNull()
 {
     Assert.Null(new StaticWeakReference().Target);
 }