public void Init_FlowIsInitialized() { using (_testRepository = new Repository(_testPath)) { _testRepository.Flow().Init(new GitFlowRepoSettings(), author); Assert.True(_testRepository.Flow().IsInitialized()); } }
public void Feature_StartNewFeatureCreatesNewBranch() { using (_testRepository = new Repository(_testPath)) { var fullBranchname = _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Feature) + "testFeature"; var newBranch = _testRepository.Branches[fullBranchname]; if (newBranch != null) TestHelpers.DeleteBranch(_testRepository, newBranch); Assert.Null(_testRepository.Branches[fullBranchname]); var info = _testRepository.Flow().StartNewFeature("testFeature"); Assert.NotNull(info); newBranch = _testRepository.Branches[fullBranchname]; Assert.NotNull(newBranch); //TestHelpers.DeleteBranch(_testRepository,newBranch); } }
public void Feature_PublishFeatureCreatesRemote() { using (_testRepository = new Repository(_testPath)) { string branchName = TestHelpers.RandomString(8); var fullBranchname = _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Feature) + branchName; var newBranch = _testRepository.Branches[fullBranchname]; if (newBranch != null) TestHelpers.DeleteBranch(_testRepository, newBranch); var info = _testRepository.Flow().StartNewFeature(branchName); Assert.False(_testRepository.Branches[fullBranchname].IsTracking); _testRepository.Flow().PublishFeature(branchName); Assert.True(_testRepository.Branches[fullBranchname].IsTracking); //TestHelpers.DeleteBranch(_testRepository,newBranch); } }
public void Init_FlowSetsConfigToDefaultValues() { using (_testRepository = new Repository(_testPath)) { _testRepository.Flow().Init(new GitFlowRepoSettings(), author); //TODO Finish Assert.Equal( _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Master), GitFlowSetting.Master.GetAttribute<GitFlowConfigAttribute>().DefaultValue ); Assert.Equal( _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Develop), GitFlowSetting.Develop.GetAttribute<GitFlowConfigAttribute>().DefaultValue ); } }
public void Init_EmptyFlowCreatesBranches() { using (_testRepository = new Repository(_testPath)) { _testRepository.Flow().Init(new GitFlowRepoSettings(), author); Assert.Equal(_testRepository.Branches.Count(), 2); Assert.NotNull(_testRepository.Branches.FirstOrDefault( x => string.Equals(x.FriendlyName, GitFlowSetting.Master.GetAttribute<GitFlowConfigAttribute>().DefaultValue, StringComparison.OrdinalIgnoreCase))); Assert.NotNull(_testRepository.Branches.FirstOrDefault( x => string.Equals(x.FriendlyName, GitFlowSetting.Develop.GetAttribute<GitFlowConfigAttribute>().DefaultValue, StringComparison.OrdinalIgnoreCase))); } }
public void Init_FlowWithExistingBranches(string masterBranch, string devBranch) { using (_testRepository = new Repository(_testPath)) { var settings = new GitFlowRepoSettings(); Signature committer = author; var opts = new CommitOptions { AllowEmptyCommit = true }; _testRepository.Commit("Initial commit", author, committer, opts); TestHelpers.CreateLocalTestBranch(_testRepository, masterBranch, GitFlowSetting.Master, settings); TestHelpers.CreateLocalTestBranch(_testRepository, devBranch, GitFlowSetting.Develop, settings); _testRepository.Flow().Init(settings, author); Assert.NotNull(_testRepository.Branches.FirstOrDefault( x => string.Equals(x.FriendlyName, settings.GetSetting(GitFlowSetting.Master), StringComparison.OrdinalIgnoreCase))); Assert.NotNull(_testRepository.Branches.FirstOrDefault( x => string.Equals(x.FriendlyName, settings.GetSetting(GitFlowSetting.Develop), StringComparison.OrdinalIgnoreCase))); } }
public void Init_TestRepositoryContainsDevelopBranch() { using (_testRepository = new Repository(_testPath)) { _testRepository.Flow().Init(new GitFlowRepoSettings(), author); Assert.NotNull(_testRepository.Branches[ _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Develop)]); } }
public void Init_TestPrefixIsSet() { using (_testRepository = new Repository(_testPath)) { _testRepository.Flow().Init(new GitFlowRepoSettings(), author); var prefix = _testRepository.Flow().GetPrefixByBranch(GitFlowSetting.Develop); Assert.NotNull(prefix); Assert.NotEmpty(prefix); } }