Inheritance: System.Log
示例#1
0
        public void Should_not_keep_file_that_was_added_and_deleted_in_the_same_commit()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.SingleOrDefault(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/gnome-terminal.desktop.in")
            .Should().Be.Null();
        }
示例#2
0
        public void Should_not_take_sumdiff_if_touched_paths_were_not_requested()
        {
            log = CreateLog("11", logXml_1.ToStream(), null, "");

            string info = log.Revision + log.Author + log.Message + log.Date.ToString();

            svnStub.AssertWasNotCalled(x => x.DiffSum("11"));
        }
示例#3
0
        public void Should_keep_replacing_without_source_as_modification()
        {
            log = CreateLog("4575", logXml_6.ToStream(), diffSumXml_6.ToStream(), "file:///E:/repo/nhibernate/svn");

            log.TouchedFiles.Count()
            .Should().Be(1);
            log.TouchedFiles.Single().Action
            .Should().Be(TouchedFile.TouchedFileAction.MODIFIED);
        }
示例#4
0
        public void Should_determine_action_for_added_and_replaced_files_as_added()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.ADDED).Count()
            .Should().Be(11);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.MODIFIED).Count()
            .Should().Be(0);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.DELETED).Count()
            .Should().Be(0);
        }
示例#5
0
        public void Should_keep_replaced_files_as_deleted_and_added()
        {
            log = CreateLog("4711", logXml_4.ToStream(), diffSumXml_4.ToStream(), "file:///E:/repo/gnome-vfs/svn");

            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.DELETED).Count()
            .Should().Be(2);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.ADDED).Count()
            .Should().Be(2);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.MODIFIED).Count()
            .Should().Be(0);
        }
示例#6
0
        public void Should_keep_alphabetically_sorted_list_of_touched_paths()
        {
            log = CreateLog("11", logXml_1.ToStream(), diffSumXml_1.ToStream(), repositoryPath);

            log.TouchedFiles.Select(x => x.Path).ToArray()
            .Should().Have.SameSequenceAs(new string[]
            {
                "/trunk/autogen.sh",
                "/trunk/ChangeLog",
                "/trunk/po/POTFILES.in",
                "/trunk/src/profile-editor.c"
            });
        }
示例#7
0
        public void Should_keep_action_for_each_touched_path()
        {
            log = CreateLog("11", logXml_1.ToStream(), diffSumXml_1.ToStream(), repositoryPath);

            log.TouchedFiles.Select(x => x.Action).ToArray()
            .Should().Have.SameSequenceAs(new TouchedFile.TouchedFileAction[]
            {
                TouchedFile.TouchedFileAction.MODIFIED,
                TouchedFile.TouchedFileAction.MODIFIED,
                TouchedFile.TouchedFileAction.ADDED,
                TouchedFile.TouchedFileAction.MODIFIED,
            });
        }
示例#8
0
        public void Should_keep_deletes_files_for_deleted_directory()
        {
            log = CreateLog("1404", logXml_5.ToStream(), diffSumXml_5.ToStream(), repositoryPath);
            svnStub.Stub(x => x.List("1403", "/trunk/src/Attic"))
            .Return(list_5_1.ToStream());
            svnStub.Stub(x => x.List("1403", "/trunk/src/Attic/eel"))
            .Return(list_5_2.ToStream());

            log.TouchedFiles.Select(x => x.Path).ToArray()
            .Should().Have.SameValuesAs(new string[]
            {
                "/trunk/src/Attic/.cvsignore",
                "/trunk/src/Attic/eel/.cvsignore"
            });
        }
示例#9
0
        public void Should_parse_general_data_about_revision()
        {
            log = CreateLog("11", logXml_1.ToStream(), null, "");

            log.Revision
            .Should().Be("11");
            log.Author
            .Should().Be("hp");
            log.Date
            .Should().Be(new DateTime(2002, 1, 16, 6, 6, 17));
            log.Message
            .Should()
            .Contain("configure.in: fixes")
            .And
            .Contain("autogen.sh: get rid of horrible autogen subdirs feature");
        }
示例#10
0
        public void Should_keep_files_added_in_copied_directory()
        {
            log = CreateLog("3868", logXml_7.ToStream(), diffSumXml_7.ToStream(), "file:///E:/repo/nhibernate/svn");

            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.ADDED).Count()
            .Should().Be(2);
            log.TouchedFiles.Single(x => x.Path == "/trunk/nhibernate/src/NHibernate.Test/HQL/Animal.cs")
            .Satisfy(x =>
                     x.SourcePath == "/trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/Animal.cs"
                     &&
                     x.SourceRevision == "3865"
                     );
            log.TouchedFiles.Single(x => x.Path == "/trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs")
            .Satisfy(x =>
                     x.SourcePath == null
                     &&
                     x.SourceRevision == null
                     );
        }
示例#11
0
        public void Should_set_source_path_and_revision_for_copied_files()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/NEWS")
            .Satisfy(x =>
                     x.SourcePath == "/branches/gnome-2-6/NEWS" &&
                     x.SourceRevision == "1216"
                     );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/gnome-terminal.desktop.in.in")
            .Satisfy(x =>
                     x.SourcePath == "/branches/gnome-2-6/gnome-terminal.desktop.in.in" &&
                     x.SourceRevision == "1216"
                     );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/po/POTFILES.in")
            .Satisfy(x =>
                     x.SourcePath == "/trunk/po/POTFILES.in" &&
                     x.SourceRevision == "1216"
                     );
        }
示例#12
0
        public void Should_set_source_path_and_revision_for_files_in_copied_dir()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/README")
            .Satisfy(x =>
                     x.SourcePath == "/trunk/README" &&
                     x.SourceRevision == "1189"
                     );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/src/terminal.c")
            .Satisfy(x =>
                     x.SourcePath == "/trunk/src/terminal.c" &&
                     x.SourceRevision == "1189"
                     );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/po/ar.po")
            .Satisfy(x =>
                     x.SourcePath == "/branches/gnome-2-6/po/ar.po" &&
                     x.SourceRevision == "1216"
                     );
        }
示例#13
0
        public void Should_set_source_path_and_revision_for_files_in_copied_dir()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/README")
                .Satisfy(x =>
                    x.SourcePath == "/trunk/README" &&
                    x.SourceRevision == "1189"
                );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/src/terminal.c")
                .Satisfy(x =>
                    x.SourcePath == "/trunk/src/terminal.c" &&
                    x.SourceRevision == "1189"
                );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/po/ar.po")
                .Satisfy(x =>
                    x.SourcePath == "/branches/gnome-2-6/po/ar.po" &&
                    x.SourceRevision == "1216"
                );
        }
示例#14
0
        public void Should_keep_action_for_each_touched_path()
        {
            log = CreateLog("11", logXml_1.ToStream(), diffSumXml_1.ToStream(), repositoryPath);

            log.TouchedFiles.Select(x => x.Action).ToArray()
                .Should().Have.SameSequenceAs(new TouchedFile.TouchedFileAction[]
                {
                    TouchedFile.TouchedFileAction.MODIFIED,
                    TouchedFile.TouchedFileAction.MODIFIED,
                    TouchedFile.TouchedFileAction.ADDED,
                    TouchedFile.TouchedFileAction.MODIFIED,
                });
        }
示例#15
0
        public void Should_keep_alphabetically_sorted_list_of_touched_paths()
        {
            log = CreateLog("11", logXml_1.ToStream(), diffSumXml_1.ToStream(), repositoryPath);

            log.TouchedFiles.Select(x => x.Path).ToArray()
                .Should().Have.SameSequenceAs(new string[]
                {
                    "/trunk/autogen.sh",
                    "/trunk/ChangeLog",
                    "/trunk/po/POTFILES.in",
                    "/trunk/src/profile-editor.c"
                });
        }
示例#16
0
        public void Should_keep_files_added_in_copied_directory()
        {
            log = CreateLog("3868", logXml_7.ToStream(), diffSumXml_7.ToStream(), "file:///E:/repo/nhibernate/svn");

            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.ADDED).Count()
                .Should().Be(2);
            log.TouchedFiles.Single(x => x.Path == "/trunk/nhibernate/src/NHibernate.Test/HQL/Animal.cs")
                .Satisfy(x =>
                    x.SourcePath == "/trunk/nhibernate/src/NHibernate.Test/HQLFunctionTest/Animal.cs"
                    &&
                    x.SourceRevision == "3865"
                );
            log.TouchedFiles.Single(x => x.Path == "/trunk/nhibernate/src/NHibernate.Test/HQL/HqlFixture.cs")
                .Satisfy(x =>
                    x.SourcePath == null
                    &&
                    x.SourceRevision == null
                );
        }
示例#17
0
        public void Should_keep_deletes_files_for_deleted_directory()
        {
            log = CreateLog("1404", logXml_5.ToStream(), diffSumXml_5.ToStream(), repositoryPath);
            svnStub.Stub(x => x.List("1403", "/trunk/src/Attic"))
                .Return(list_5_1.ToStream());
            svnStub.Stub(x => x.List("1403", "/trunk/src/Attic/eel"))
                .Return(list_5_2.ToStream());

            log.TouchedFiles.Select(x => x.Path).ToArray()
                .Should().Have.SameValuesAs(new string[]
                {
                    "/trunk/src/Attic/.cvsignore",
                    "/trunk/src/Attic/eel/.cvsignore"
                });
        }
示例#18
0
        public void Should_keep_replacing_without_source_as_modification()
        {
            log = CreateLog("4575", logXml_6.ToStream(), diffSumXml_6.ToStream(), "file:///E:/repo/nhibernate/svn");

            log.TouchedFiles.Count()
                .Should().Be(1);
            log.TouchedFiles.Single().Action
                .Should().Be(TouchedFile.TouchedFileAction.MODIFIED);
        }
示例#19
0
        public void Should_keep_replaced_files_as_deleted_and_added()
        {
            log = CreateLog("4711", logXml_4.ToStream(), diffSumXml_4.ToStream(), "file:///E:/repo/gnome-vfs/svn");

            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.DELETED).Count()
                .Should().Be(2);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.ADDED).Count()
                .Should().Be(2);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.MODIFIED).Count()
                .Should().Be(0);
        }
示例#20
0
        public void Should_determine_action_for_added_and_replaced_files_as_added()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.ADDED).Count()
                .Should().Be(11);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.MODIFIED).Count()
                .Should().Be(0);
            log.TouchedFiles.Where(x => x.Action == TouchedFile.TouchedFileAction.DELETED).Count()
                .Should().Be(0);
        }
示例#21
0
        public void Should_not_keep_file_that_was_added_and_deleted_in_the_same_commit()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.SingleOrDefault(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/gnome-terminal.desktop.in")
                .Should().Be.Null();
        }
示例#22
0
        public void Should_set_source_path_and_revision_for_copied_files()
        {
            log = CreateLog("1217", logXml_3.ToStream(), diffSumXml_3.ToStream(), repositoryPath);

            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/NEWS")
                .Satisfy(x =>
                    x.SourcePath == "/branches/gnome-2-6/NEWS" &&
                    x.SourceRevision == "1216"
                );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/gnome-terminal.desktop.in.in")
                .Satisfy(x =>
                    x.SourcePath == "/branches/gnome-2-6/gnome-terminal.desktop.in.in" &&
                    x.SourceRevision == "1216"
                );
            log.TouchedFiles.Single(x => x.Path == "/tags/GNOME_TERMINAL_2_6_1/po/POTFILES.in")
                .Satisfy(x =>
                    x.SourcePath == "/trunk/po/POTFILES.in" &&
                    x.SourceRevision == "1216"
                );
        }
示例#23
0
        public void Should_parse_general_data_about_revision()
        {
            log = CreateLog("11", logXml_1.ToStream(), null, "");

            log.Revision
                .Should().Be("11");
            log.Author
                .Should().Be("hp");
            log.Date
                .Should().Be(DateTime.Parse("16.01.2002 06:06:17"));
            log.Message
                .Should()
                    .Contain("configure.in: fixes")
                    .And
                    .Contain("autogen.sh: get rid of horrible autogen subdirs feature");
        }
示例#24
0
        public void Should_not_take_sumdiff_if_touched_paths_were_not_requested()
        {
            log = CreateLog("11", logXml_1.ToStream(), null, "");

            string info = log.Revision + log.Author + log.Message + log.Date.ToString();

            svnStub.AssertWasNotCalled(x => x.DiffSum("11"));
        }
示例#25
0
 public void Should_be_able_to_process_strange_situation_when_no_path_in_diff()
 {
     log = CreateLog("4166", logXml_8.ToStream(), diffSumXml_8.ToStream(), "file:///E:/repo/nhibernate/svn");
 }
示例#26
0
 public void Should_be_able_to_process_strange_situation_when_no_path_in_diff()
 {
     log = CreateLog("4166", logXml_8.ToStream(), diffSumXml_8.ToStream(), "file:///E:/repo/nhibernate/svn");
 }