コード例 #1
0
        public void Apply_Feature_Branch_Changes_Version_Resets_On_Merge()
        {
            using (var fixture = new SimpleVersionRepositoryFixture())
            {
                // Arrange
                var config = fixture.GetConfig();

                fixture.MakeACommit();
                fixture.MakeACommit();
                fixture.MakeACommit();
                fixture.MakeACommit();

                fixture.BranchTo("feature/other");
                fixture.MakeACommit();

                config.Version = "0.1.1";
                fixture.SetConfig(config);

                fixture.MakeACommit();
                fixture.MakeACommit();

                fixture.Checkout("master");
                fixture.MergeNoFF("feature/other");

                var context = new VersionContext(fixture.Repository);

                // Act
                _sut.Apply(context);

                // Assert
                context.Result.Height.Should().Be(1);
            }
        }
コード例 #2
0
        public void Apply_Feature_Branch_No_Change_Increments_Merge_Once()
        {
            using (var fixture = new SimpleVersionRepositoryFixture())
            {
                // Arrange
                fixture.MakeACommit();
                fixture.MakeACommit();
                fixture.MakeACommit();
                fixture.MakeACommit();

                fixture.BranchTo("feature/other");
                fixture.MakeACommit();
                fixture.MakeACommit();
                fixture.MakeACommit();

                fixture.Checkout("master");
                fixture.MergeNoFF("feature/other");

                var context = new VersionContext(fixture.Repository);

                // Act
                _sut.Apply(context);

                context.Result.Height.Should().Be(6);
            }
        }