Exemplo n.º 1
0
    public void NewestSemVerTag_ReturnNullWhenNoTagPointingAtTheSpecifiedCommitHasBeenFound()
    {
        var tagNames = new[] { "a", "9.0.0", "z", "0.1.0", "11.1.0", "0.2.0" };

        var col = new MockTagCollection();

        foreach (var tagName in tagNames)
        {
            col.Add(new MockTag
            {
                NameEx       = tagName,
                TargetEx     = null,
                AnnotationEx = new MockTagAnnotation
                {
                    TaggerEx = new Signature("a", "", 5.Seconds().Ago())
                }
            });
        }

        var repo = new MockRepository {
            Tags = col
        };

        var version = repo.NewestSemVerTag(new MockCommit());

        Assert.IsNull(version);
    }
Exemplo n.º 2
0
    public void TagsByDate_HonorChainedAnnotatedTags()
    {
        var c = new MockCommit();

        var col = new MockTagCollection();

        var first = new MockTag
        {
            NameEx       = "first",
            TargetEx     = c,
            AnnotationEx = new MockTagAnnotation
            {
                TaggerEx = new Signature("a", "", 5.Seconds().Ago()),
                TargetEx = c,
            }
        };

        col.Add(first);

        col.Add(new MockTag
        {
            NameEx       = "second",
            TargetEx     = first.Annotation,
            AnnotationEx = new MockTagAnnotation
            {
                TaggerEx = new Signature("a", "", 2.Seconds().Ago()),
                TargetEx = c,
            }
        });

        var repo = new MockRepository {
            Tags = col
        };

        var tags = repo.TagsByDate(c);

        Assert.AreEqual("second", tags.First().Name);
    }
Exemplo n.º 3
0
    public void NewestSemVerTag_ReturnNullWhenNoTagPointingAtTheSpecifiedCommitHasBeenFound()
    {
        var tagNames = new[] { "a", "9.0.0", "z", "0.1.0", "11.1.0", "0.2.0" };

        var col = new MockTagCollection();
        foreach (var tagName in tagNames)
        {
            col.Add(new MockTag
            {
                NameEx = tagName,
                TargetEx = null,
                AnnotationEx = new MockTagAnnotation
                {
                    TaggerEx = new Signature("a", "", 5.Seconds().Ago())
                }
            });
        }

        var repo = new MockRepository { Tags = col };

        var version = repo.NewestSemVerTag(new MockCommit());

        Assert.IsNull(version);
    }
Exemplo n.º 4
0
 public MockRepository()
 {
     Tags = new MockTagCollection();
     Refs = new MockReferenceCollection();
 }
Exemplo n.º 5
0
 public MockRepository()
 {
     Tags = new MockTagCollection();
     Refs = new MockReferenceCollection();
 }
Exemplo n.º 6
0
    public void TagsByDate_HonorChainedAnnotatedTags()
    {
        var c = new MockCommit();

        var col = new MockTagCollection();

        var first = new MockTag
                      {
                          NameEx = "first",
                          TargetEx = c,
                          AnnotationEx = new MockTagAnnotation
                                         {
                                             TaggerEx = new Signature("a", "", 5.Seconds().Ago()),
                                             TargetEx = c,
                                         }
                      };

        col.Add(first);

        col.Add(new MockTag
                {
                    NameEx = "second",
                    TargetEx = first.Annotation,
                    AnnotationEx = new MockTagAnnotation
                    {
                        TaggerEx = new Signature("a", "", 2.Seconds().Ago()),
                        TargetEx = c,
                    }

                });

        var repo = new MockRepository { Tags = col };

        var tags = repo.TagsByDate(c);

        Assert.AreEqual("second", tags.First().Name);
    }