public void FixTrunkRemoteBranchHasTrunkBranchIsNotRebaseTest() { // Prepare var mock = new Mock <ICommandRunner>(); mock.Setup(f => f.Run("git", It.IsAny <string>())) .Returns(0); MetaInfo metaInfo = new MetaInfo() { RemoteBranches = new List <string>() { "trunk" } }; Options option = new Options() { Rebase = false }; IFixer fixer = new Fixer(metaInfo, option, mock.Object, "", null, null); // Act fixer.FixTrunk(); // Assert mock.Verify(f => f.Run("git", "checkout svn/trunk"), Times.Once()); mock.Verify(f => f.Run("git", "branch -D master"), Times.Once()); mock.Verify(f => f.Run("git", "checkout -f -b master"), Times.Once()); mock.Verify(f => f.Run("git", "checkout -f master"), Times.Never()); }
public void FixTrunkRemoteBranchIsNullTest() { // Prepare var mock = new Mock <ICommandRunner>(); mock.Setup(f => f.Run("git", It.IsAny <string>())) .Returns(0); MetaInfo metaInfo = new MetaInfo(); IFixer fixer = new Fixer(metaInfo, new Options(), mock.Object, "", null, null); // Act fixer.FixTrunk(); // Assert mock.Verify(f => f.Run("git", "checkout -f master"), Times.Once()); }