コード例 #1
0
            public void SemVer2PackageVersionMeansSemVer2(string packageVersion, bool isSemVer2)
            {
                var leaf = new PackageDetailsCatalogLeaf
                {
                    PackageVersion  = packageVersion,
                    VerbatimVersion = "1.0.0",
                };

                var actual = leaf.IsSemVer2();

                Assert.Equal(isSemVer2, actual);
            }
コード例 #2
0
            public void AllowsNullDependencyGroups()
            {
                var leaf = new PackageDetailsCatalogLeaf
                {
                    PackageVersion  = "1.0.0",
                    VerbatimVersion = "1.0.0",
                };

                var actual = leaf.IsSemVer2();

                Assert.False(actual);
            }
コード例 #3
0
            public void SemVer2DependencyVersionRangeMeansSemVer2(string range, bool isSemVer2)
            {
                var leaf = new PackageDetailsCatalogLeaf
                {
                    PackageVersion   = "1.0.0",
                    VerbatimVersion  = "1.0.0",
                    DependencyGroups = new List <PackageDependencyGroup>
                    {
                        new PackageDependencyGroup
                        {
                            Dependencies = new List <PackageDependency>
                            {
                                new PackageDependency
                                {
                                    Range = "0.0.0",
                                },
                            },
                        },
                        new PackageDependencyGroup
                        {
                            Dependencies = new List <PackageDependency>
                            {
                                new PackageDependency
                                {
                                    Range = "0.0.1",
                                },
                                new PackageDependency
                                {
                                    Range = range,
                                },
                            },
                        },
                    },
                };

                var actual = leaf.IsSemVer2();

                Assert.Equal(isSemVer2, actual);
            }
コード例 #4
0
            public void AllowsNullVerbatimVersion()
            {
                var leaf = new PackageDetailsCatalogLeaf
                {
                    PackageVersion   = "1.0.0",
                    DependencyGroups = new List <PackageDependencyGroup>
                    {
                        new PackageDependencyGroup
                        {
                            Dependencies = new List <PackageDependency>
                            {
                                new PackageDependency
                                {
                                    Range = "[1.0.0, )",
                                },
                            },
                        },
                    },
                };

                var actual = leaf.IsSemVer2();

                Assert.False(actual);
            }