public void CanChangeDevelopTagViaConfig()
        {
            var config = new Config
            {
                Branches =
                {
                    ["dev"] = new BranchConfig
                    {
                    Regex          = "dev",
                    Tag            = "alpha",
                    SourceBranches = new List <string>()
                    }
                }
            };

            using (var context = new TestVesionContext())
            {
                context.CreateBranch("dev");
                context.WriteTextAndCommit("dummy.txt", "", "init commit");
                context.MakeTaggedCommit("1.0.0");
                context.MakeCommit();

                context.AssertFullSemver(config, "1.1.0-alpha.1");
            }
        }
Example #2
0
 public void WhenDevelopBranchedFromTaggedCommitOnDefaultVersionDoesNotChange()
 {
     using (var context = new TestVesionContext())
     {
         context.CreateBranch("dev");
         context.WriteTextAndCommit("dummy.txt", "", "init commit");
         context.MakeTaggedCommit("1.0.0");
         context.AssertFullSemver("1.0.0");
     }
 }
 public void WhenBranchNameHasRUChars_ItIsStillWorking(string branchName)
 {
     using (var context = new TestVesionContext())
     {
         context.WriteTextAndCommit("dummy.txt", "", "init commit");
         context.CreateBranch(branchName);
         context.WriteTextAndCommit("dummy.txt", "", "2nd commit");
         Assert.That(context.CurrentBranch.Name, Is.EqualTo(branchName));
     }
 }
        public void WhenDevelopBranchedFromMaster_MinorIsIncreased()
        {
            using (var context = new TestVesionContext())
            {
                context.CreateBranch("dev");
                context.WriteTextAndCommit("dummy.txt", "", "init commit");
                context.MakeTaggedCommit("1.0.0");
                context.MakeCommit();

                context.AssertFullSemver("1.1.0-alpha.1");
            }
        }
        public void WhenTagBeforeDevelopBranched_ShouldUseTaggedCommit()
        {
            using (var context = new TestVesionContext())
            {
                context.WriteTextAndCommit("dummy.txt", "", "init commit");
                context.MakeTaggedCommit("1.0.0");

                context.CreateBranch("dev");
                context.MakeCommit();
                context.MakeCommit();

                context.AssertFullSemver("1.1.0-alpha.2");
            }
        }
        public void WhenDeveloperBranchExistsDontTreatAsDevelop()
        {
            using (var context = new TestVesionContext())
            {
                context.CreateBranch("default");
                context.MakeCommit();

                context.CreateBranch("developer");
                context.WriteTextAndCommit("dummy.txt", "", "init commit");
                context.MakeTaggedCommit("1.0.0");
                context.MakeCommit();

                context.AssertFullSemver("1.0.1-developer.1+1"); // this tag should be the branch name by default, not unstable
            }
        }
Example #7
0
        public void WhenDevelopHasMultipleCommits_SpecifyExistingCommitId()
        {
            using (var context = new TestVesionContext())
            {
                context.CreateBranch("dev");
                context.WriteTextAndCommit("dummy.txt", "", "init commit");
                context.MakeTaggedCommit("1.0.0");

                context.MakeCommit();
                context.MakeCommit();
                context.MakeCommit();

                var thirdCommit = context.Tip();
                context.MakeCommit();
                context.MakeCommit();

                context.AssertFullSemver("1.1.0-alpha.3", commitId: thirdCommit.Hash);
            }
        }
        public void CanHandleContinuousDelivery()
        {
            var config = new Config
            {
                Branches =
                {
                    ["develop"] = new BranchConfig
                    {
                    VersioningMode = VersioningMode.ContinuousDelivery
                    }
                }
            };

            using (var context = new TestVesionContext())
            {
                context.CreateBranch("dev");
                context.MakeCommit();
                context.MakeTaggedCommit("1.0.0");
                context.MakeCommit();
                context.MakeTaggedCommit("1.1.0-alpha7");

                context.AssertFullSemver(config, "1.1.0-alpha.7");
            }
        }