コード例 #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);
        }
コード例 #2
0
        public void WhenPackIsNotItem_ResolveNull()
        {
            var resolver = new PackUriProvider();

            resolver.Solution = this.solution;

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

                Assert.Null(target.Info);
            }
        }
コード例 #4
0
            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);
            }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public void WhenGettingServiceAndNotFound_ThenReturnsNull()
 {
     Assert.Null(this.target.GetService(typeof(object)));
 }
コード例 #8
0
 public void WhenUriIsNotItem_ReturnsNull()
 {
     Assert.Null(this.service.ResolveUri <ResourcePack>(new Uri("pack://application:,,,/TestProviders;component/foo.bmp")));
 }
コード例 #9
0
 public void WhenConvertingFromInValidValue_ThenReturnsNull()
 {
     Assert.Null(this.converter.ConvertFrom(this.context, CultureInfo.InvariantCulture, "sdsd"));
 }
コード例 #10
0
            public virtual void when_I_get_a_non_existent_property_then_returns_null_with_dynamic_property_syntax()
            {
                string name = Properties.Foo;

                Assert.Null(name);
            }
コード例 #11
0
 public void WhenConstructed_ThenTargetIsNull()
 {
     Assert.Null(new StaticWeakReference().Target);
 }