コード例 #1
0
 public void CloneProjectWithChangesets()
 {
     h.SetupFake(r =>
     {
         r.Changeset(1, "Project created from template", DateTime.Parse("2012-01-01 12:12:12 -05:00"))
         .Change(TfsChangeType.Add, TfsItemType.Folder, "$/MyProject");
         r.Changeset(2, "First commit", DateTime.Parse("2012-01-02 12:12:12 -05:00"))
         .Change(TfsChangeType.Add, TfsItemType.Folder, "$/MyProject/Folder")
         .Change(TfsChangeType.Add, TfsItemType.File, "$/MyProject/Folder/File.txt", "File contents")
         .Change(TfsChangeType.Add, TfsItemType.File, "$/MyProject/README", "tldr");
     });
     h.Run("clone", h.TfsUrl, "$/MyProject");
     h.AssertCommitMessage("MyProject", "HEAD", "First commit", "", "git-tfs-id: [" + h.TfsUrl + "]$/MyProject;C2");
     h.AssertFileInWorkspace("MyProject", "Folder/File.txt", "File contents");
     h.AssertFileInWorkspace("MyProject", "README", "tldr");
     AssertNewClone("MyProject", RefsInNewClone,
                    commit: "d64d883266eca65bede947c79529318718a0d8eb",
                    tree: "41ab05d8f2a0f7f7f3a39c623e94fee68f64797e");
 }
コード例 #2
0
        public void CloneProjectWithInternationalCharactersInCommitMessages()
        {
            h.SetupFake(r =>
            {
                r.Changeset(1, "Project created from template", DateTime.Parse("2012-01-01 12:12:12 -05:00"))
                .Change(TfsChangeType.Add, TfsItemType.Folder, "$/MyProject");
                r.Changeset(2, "Blåbærsyltetøy", DateTime.Parse("2012-01-02 12:12:12 -05:00"))
                .Change(TfsChangeType.Add, TfsItemType.Folder, "$/MyProject/Folder")
                .Change(TfsChangeType.Add, TfsItemType.File, "$/MyProject/Folder/File.txt", "File contents");
            });
            h.Run("clone", h.TfsUrl, "$/MyProject");
            h.AssertGitRepo("MyProject");
            AssertRefs("cd14e6e28abffd625412dae36d9d9659bf6cb68c");
            h.AssertFileInWorkspace("MyProject", "Folder/File.txt", "File contents");

            var expectedCommitMessage = new System.Text.StringBuilder();

            expectedCommitMessage.AppendLine("Blåbærsyltetøy");
            expectedCommitMessage.AppendLine("");
            expectedCommitMessage.AppendLine("git-tfs-id: [http://does/not/matter]$/MyProject;C2");

            h.AssertCommitMessage("MyProject", "HEAD", expectedCommitMessage.ToString());
        }