CreateFromContent() 공개 메소드

public CreateFromContent ( GitObjectStream content ) : GitObject
content GitObjectStream
리턴 GitObject
        public void ParsesCommitter()
        {
            var factory = new ObjectFactory();
            var commit = factory.CreateFromContent(CommitContent) as Commit;

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

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

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

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

            Assert.That(tree.Contents.Count, Is.EqualTo(8));
        }
        public void ContentWithCommitHeaderReturnsCommitObject()
        {
            var factory = new ObjectFactory();
            var obj = factory.CreateFromContent(FakeCommitContent);

            Assert.That(obj, Is.TypeOf<Commit>());
        }
        public void ContentLengthParsed()
        {
            var factory = new ObjectFactory();
            var obj = factory.CreateFromContent(FakeCommitContent);

            Assert.That(obj.ContentLength, Is.EqualTo(1234));
        }
        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));
        }
        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"));
        }
        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"));
        }
        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));
        }