public void CustomGitOps_ExecutesSixCommands() { //------------Setup for test-------------------------- var executor = new Mock <IExternalProcessExecutor>(); CustomGitOps.SetCustomGitTool(executor.Object); executor.Verify(p => p.Start(It.IsAny <ProcessStartInfo>()), Times.Exactly(6)); }
public void CustomGitOps_ExecutesThreeCommands() { //------------Setup for test-------------------------- CustomGitOps.SetCustomGitTool(new ExternalProcessExecutor()); var userProfile = Environment.SpecialFolder.UserProfile; var currentUserProfileRoot = Environment.GetFolderPath(userProfile); var globalConfig = Directory.GetFiles(currentUserProfileRoot, ".gitconfig")[0]; using (var a = File.OpenRead(globalConfig)) { StreamReader b = new StreamReader(a); var gitText = b.ReadToEnd(); StringAssert.Contains(gitText, "tool = DiffMerge"); StringAssert.Contains(gitText, "cmd = 'C:/Program Files (x86)/Warewolf/Studio/MergePowershellScript/customMerge.sh' $REMOTE"); StringAssert.Contains(gitText, "trustExitCode = false"); StringAssert.Contains(gitText, "[difftool \"DiffMerge\"]"); StringAssert.Contains(gitText, "[mergetool \"DiffMerge\"]"); } }