示例#1
0
        public void OneUpdate_MakeCommitDetails_HasPublishedDate()
        {
            var updates = PackageUpdates.For(MakePackageForV110())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Does.Contain("`foo.bar 1.2.3` was published at `2018-02-19T11:12:07Z`"));
        }
示例#2
0
        public void TwoUpdatesSameVersion_MakeCommitDetails_HasStandardTexts()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV110InProject3())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            AssertContainsStandardText(report);
        }
示例#3
0
        public void OneUpdate_MakeCommitDetails_HasVersionInfo()
        {
            var updates = PackageUpdates.For(MakePackageForV110())
                          .InList();

            var report = CommitWording.MakeCommitDetails(updates);

            Assert.That(report, Does.StartWith("NuKeeper has generated a minor update of `foo.bar` to `1.2.3` from `1.1.0`"));
        }
示例#4
0
        public void TwoUpdatesSameVersion_MakeCommitDetails_HasVersionInfo()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV110InProject3())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Does.StartWith("NuKeeper has generated a minor update of `foo.bar` to `1.2.3` from `1.1.0`"));
        }
示例#5
0
        public void OneUpdate_MakeCommitDetails_HasStandardTexts()
        {
            var updates = PackageUpdates.For(MakePackageForV110())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            AssertContainsStandardText(report);
        }
示例#6
0
        public void TwoUpdates_MakeCommitDetails_HasVersionInfo()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV100())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Does.StartWith("NuKeeper has generated a minor update of `foo.bar` to `1.2.3`"));
            Assert.That(report, Does.Contain("2 versions of `foo.bar` were found in use: `1.1.0`, `1.0.0`"));
        }
示例#7
0
        public void OneUpdate_MakeCommitDetails_HasProjectDetails()
        {
            var updates = PackageUpdates.For(MakePackageForV110())
                          .InList();

            var report = CommitWording.MakeCommitDetails(updates);

            Assert.That(report, Does.Contain("1 project update:"));
            Assert.That(report, Does.Contain("Updated `folder\\src\\project1\\packages.config` to `foo.bar` `1.2.3` from `1.1.0`"));
        }
        public void MakeCommitMessage_TwoUpdatesIsCorrect()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV100());

            var report = _sut.MakeCommitMessage(updates);

            Assert.That(report, Is.Not.Null);
            Assert.That(report, Is.Not.Empty);
            Assert.That(report, Is.EqualTo("Automatic update of foo.bar to 1.2.3"));
        }
示例#9
0
        public void MakeCommitMessage_OneUpdateIsCorrect()
        {
            var updates = PackageUpdates.For(MakePackageForV110());

            var report = CommitWording.MakeCommitMessage(updates);

            Assert.That(report, Is.Not.Null);
            Assert.That(report, Is.Not.Empty);
            Assert.That(report, Is.EqualTo(":package: Automatic update of foo.bar to 1.2.3"));
        }
示例#10
0
        public void TwoUpdates_MakeCommitDetails_NotEmpty()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV100())
                          .InList();

            var report = CommitWording.MakeCommitDetails(updates);

            Assert.That(report, Is.Not.Null);
            Assert.That(report, Is.Not.Empty);
        }
示例#11
0
        public void TwoUpdatesSameVersion_MakeCommitDetails_NotEmpty()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV110InProject3())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Is.Not.Null);
            Assert.That(report, Is.Not.Empty);
        }
示例#12
0
        public void TwoUpdates_MakeCommitDetails_HasStandardTexts()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV100())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            AssertContainsStandardText(report);
            Assert.That(report, Does.Contain("1.0.0"));
        }
示例#13
0
        public void OneUpdate_MakeCommitDetails_IsNotEmpty()
        {
            var updates = PackageUpdates.For(MakePackageForV110())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Is.Not.Null);
            Assert.That(report, Is.Not.Empty);
        }
示例#14
0
        public void MakeCommitMessage_TwoUpdatesSameVersionIsCorrect()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV110InProject3());

            var report = _sut.MakeCommitMessage(updates);

            Assert.That(report, Is.Not.Null);
            Assert.That(report, Is.Not.Empty);
            Assert.That(report, Is.EqualTo($"{CommitEmoji} Automatic update of foo.bar to 1.2.3"));
        }
示例#15
0
        public void TwoUpdatesSameVersion_MakeCommitDetails_HasProjectList()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV110InProject3())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Does.Contain("2 project updates:"));
            Assert.That(report, Does.Contain("Updated `folder\\src\\project1\\packages.config` to `foo.bar` `1.2.3` from `1.1.0`"));
            Assert.That(report, Does.Contain("Updated `folder\\src\\project3\\packages.config` to `foo.bar` `1.2.3` from `1.1.0`"));
        }
示例#16
0
        public void MarkPullRequestTitle_UpdateIsCorrect()
        {
            var updates = PackageUpdates.For(MakePackageForV110())
                          .InList();

            var report = _sut.MakePullRequestTitle(updates);

            Assert.That(report, Is.Not.Null);
            Assert.That(report, Is.Not.Empty);
            Assert.That(report, Is.EqualTo($"{CommitEmoji} Automatic update of foo.bar to 1.2.3"));
        }
示例#17
0
        public void OneUpdate_MakeCommitDetails_HasProjectDetailsAsMarkdownTable()
        {
            var updates = PackageUpdates.For(MakePackageForV110())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Does.Contain("### 1 project update:"));
            Assert.That(report, Does.Contain("| Project   | Package   | From   | To   |"));
            Assert.That(report, Does.Contain("|:----------|:----------|-------:|-----:|"));
            Assert.That(report, Does.Contain($"| `folder\\src\\project1\\packages.config` | `foo.bar` | {NuGetVersionPackageLink("foo.bar", "1.1.0")} | {NuGetVersionPackageLink("foo.bar", "1.2.3")} |"));
        }
示例#18
0
        public void TwoUpdatesSameVersion_MakeCommitDetails_HasProjectList()
        {
            var updates = PackageUpdates.For(MakePackageForV110(), MakePackageForV110InProject3())
                          .InList();

            var report = _sut.MakeCommitDetails(updates);

            Assert.That(report, Does.Contain("2 project updates:"));
            Assert.That(report, Does.Contain("| Project   | Package   | From   | To   |"));
            Assert.That(report, Does.Contain("|:----------|:----------|-------:|-----:|"));
            Assert.That(report, Does.Contain($"| `folder\\src\\project1\\packages.config` | `foo.bar` | {NuGetVersionPackageLink("foo.bar", "1.1.0")} | {NuGetVersionPackageLink("foo.bar", "1.2.3")} |"));
            Assert.That(report, Does.Contain($"| `folder\\src\\project3\\packages.config` | `foo.bar` | {NuGetVersionPackageLink("foo.bar", "1.1.0")} | {NuGetVersionPackageLink("foo.bar", "1.2.3")} |"));
        }
        private static PackageUpdateSet OnePackageUpdateSet(string packageName, int projectCount,
                                                            List <PackageDependency> deps)
        {
            var newPackage = new PackageIdentity(packageName, new NuGetVersion("1.4.5"));
            var package    = new PackageIdentity(packageName, new NuGetVersion("1.2.3"));

            var projects = new List <PackageInProject>();

            foreach (var i in Enumerable.Range(1, projectCount))
            {
                projects.Add(MakePackageInProjectFor(package));
            }

            return(PackageUpdates.For(newPackage, StandardPublishedDate, projects, deps));
        }