public void ShouldHaveGoodName() { Globals globals = new Globals(); globals.Repository = mocks.Get <IGitRepository>(); globals.Repository.Stub(t => t.AssertValidBranchName("")).IgnoreArguments().Do((Func <string, string>) delegate(string value) { return(value); }); var initBranch4test = new InitBranchForTest(new StringWriter(), globals, null, null); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te^st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te~st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te:st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te*st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te?st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te[st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test/")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test.")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("$/repo/te:st")); Assert.Equal("test/test2", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("$/repo/te:st/test2")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te..st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test.")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te\\st.")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te@{st.")); }
public void ShouldHaveGoodName() { Globals globals = new Globals(); globals.Repository = mocks.Get<IGitRepository>(); globals.Repository.Stub(t => t.AssertValidBranchName("")).IgnoreArguments().Do ( (Func<string, string>) delegate (string value) { return value; }); var initBranch4test = new InitBranchForTest(new StringWriter(), globals , null, null); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te^st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te~st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te:st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te*st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te?st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te[st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test/")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test.")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("$/repo/te:st")); Assert.Equal("test/test2", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("$/repo/te:st/test2")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te..st")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("test.")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te\\st.")); Assert.Equal("test", initBranch4test.ExtractGitBranchNameFromTfsRepositoryPath("te@{st.")); }