コード例 #1
0
        public void ParsesCommitter()
        {
            var factory = new ObjectFactory();
            var commit = factory.CreateFromContent(CommitContent) as Commit;

            Assert.That(commit.Committer, Is.EqualTo("James Gregory <*****@*****.**>"));
        }
コード例 #2
0
        public void ParsesTreeHashId()
        {
            var factory = new ObjectFactory();
            var commit = factory.CreateFromContent(CommitContent) as Commit;

            Assert.That(commit.TreeId, Is.EqualTo("f37a9edbaa5601df27dcc24df5fcff752314b3ec"));
        }
コード例 #3
0
        public void ParsesEntryMode()
        {
            var factory = new ObjectFactory();
            var tree = factory.CreateFromContent(Stream) as Tree;

            Assert.That(tree.Contents[0].Mode, Is.EqualTo("100644"));
        }
コード例 #4
0
        public void ParsesComment()
        {
            var factory = new ObjectFactory();
            var commit = factory.CreateFromContent(CommitContent) as Commit;

            Assert.That(commit.Comment, Is.EqualTo("Added first file"));
        }
コード例 #5
0
        public void ParsesMultipleEntries()
        {
            var factory = new ObjectFactory();
            var tree = factory.CreateFromContent(Stream) as Tree;

            Assert.That(tree.Contents.Count, Is.EqualTo(8));
        }
コード例 #6
0
        public void ContentWithCommitHeaderReturnsCommitObject()
        {
            var factory = new ObjectFactory();
            var obj = factory.CreateFromContent(FakeCommitContent);

            Assert.That(obj, Is.TypeOf<Commit>());
        }
コード例 #7
0
        public void ContentLengthParsed()
        {
            var factory = new ObjectFactory();
            var obj = factory.CreateFromContent(FakeCommitContent);

            Assert.That(obj.ContentLength, Is.EqualTo(1234));
        }
コード例 #8
0
        public void ParsesTree()
        {
            var factory = new ObjectFactory();
            var tree = factory.CreateFromContent(Stream) as Tree;

            Assert.That(tree, Is.Not.Null);
            Assert.That(tree.Contents.Count, Is.AtLeast(1));
        }
コード例 #9
0
        public void ParsesEntrySha1()
        {
            var factory = new ObjectFactory();
            var tree = factory.CreateFromContent(Stream) as Tree;

            Assert.That(tree.Contents.Count, Is.AtLeast(1));
            Assert.That(tree.Contents[0].Sha1, Is.EqualTo("d6915d7880ce5b8c8d5d9e1c01a13d0b45c9f4b6"));
        }
コード例 #10
0
        public void ParsesEntryPath()
        {
            var factory = new ObjectFactory();
            var tree = factory.CreateFromContent(Stream) as Tree;

            Assert.That(tree.Contents.Count, Is.AtLeast(1));
            Assert.That(tree.Contents[0].Path, Is.EqualTo("CommitSpecificParsingTests.cs"));
        }
コード例 #11
0
        public void ParsesBlob()
        {
            var factory = new ObjectFactory();
            var blob = factory.CreateFromContent(Stream) as Blob;

            Assert.That(blob, Is.Not.Null);
            Assert.That(blob.Content.StartsWith("Git# - A .Net Git implementation"), Is.True);
            Assert.That(blob.Content.Length, Is.EqualTo(147));
        }