Ejemplo n.º 1
0
        public void GetIconId_PackageReferenceIsInstalled_ReturnsReferenceIcon()
        {
            CreatePackageReference();
            CreatePackageReferenceNode();

            IconId icon = node.GetIconId();

            Assert.AreEqual(Stock.Reference, icon);
        }
        public void GetPackageReferencesNodes_OnePackageReferenceWithUpdatedPackagesButPackageNotRestored_ReturnsOneNodeWithUpdatedVersionInformationInLabel()
        {
            CreateNode();
            AddPackageReferenceToProject("MyPackage", "1.0");
            AddUpdatedPackageForProject("MyPackage", "1.2");

            List <PackageReferenceNode> nodes = packagesFolderNode.GetPackageReferencesNodes().ToList();

            PackageReferenceNode referenceNode = nodes.FirstOrDefault();

            Assert.AreEqual(1, nodes.Count);
            Assert.AreEqual("1.2", referenceNode.UpdatedVersion.ToString());
            Assert.AreEqual("<span color='#c99c00'>MyPackage</span> <span color='grey'>(1.2 available)</span>", referenceNode.GetLabel());
            Assert.AreEqual(Stock.ReferenceWarning, referenceNode.GetIconId());
        }
Ejemplo n.º 3
0
        public async Task GetPackageReferencesNodes_OnePackageReferenceWithUpdatedPackagesButPackageNotRestored_ReturnsOneNodeWithUpdatedVersionInformationInLabel()
        {
            CreateNode();
            AddPackageReferenceToProject("MyPackage", "1.0");
            AddUpdatedPackageForProject("MyPackage", "1.2");
            await RefreshNodePackages();

            List <PackageReferenceNode> nodes = packagesFolderNode.GetPackageReferencesNodes().ToList();

            PackageReferenceNode referenceNode = nodes.FirstOrDefault();

            Assert.AreEqual(1, nodes.Count);
            Assert.AreEqual("1.2", referenceNode.UpdatedVersion.ToString());
            Assert.AreEqual("MyPackage", referenceNode.GetLabel());
            Assert.AreEqual("(1.2 available)", referenceNode.GetSecondaryLabel());
            Assert.AreEqual(Stock.Reference, referenceNode.GetIconId());
            Assert.IsTrue(referenceNode.IsDisabled());
        }