tests/TestInvalidOptions.cs
/// <summary>
/// Branch already exist but no --force option
/// </summary>
Branch already exist but no --force option
Branch already exist but no -- force option
[Fact]
        public void ForgetBranchForce()
        {
            var test = InitializeTest();
            test.Repo.Refs.Add(NewBranchRef, test.Repo.Refs.Head);
            var result = Program.Main("--keep", "/Test1",
                "--repo-dir", test.Path,
                "--branch", NewBranch,
                @"HEAD");
            Assert.NotEqual(0, result);
            Assert.Contains(string.Format("The branch [{0}] already exist. Cannot overwrite without force option", NewBranch), test.Output);
            test.Dispose();
        }
[ Fact ] public void ForgetBranchForce ( ) { var test = InitializeTest ( ) ; test . Repo . Refs . Add ( NewBranchRef , test . Repo . Refs . Head ) ; var result = Program . Main ( " " , " " , " " , test . Path , " " , NewBranch , @"HEAD" ) ; Assert . NotEqual ( 0 , result ) ; Assert . Contains ( string . Format ( " " , NewBranch ) , test . Output ) ; test . Dispose ( ) ; }
Branch already exist but no --force option
Branch already exist but no -- force option
// Add an existing branch reference // Cleanup the test only if we succeed