Exemplo n.º 1
0
        public void TestTagCollection()
        {
            var target = new TagCollection(new[] {"t1", "", ",", "t2"});
            Assert.AreEqual("T1,T2", target.ToString());

            var deserialized = TagCollection.FromString("T1,T2");
            Assert.AreEqual(target.Count, deserialized.Count);
            Assert.AreEqual(target.First(), deserialized.First());
            Assert.AreEqual(target.Last(), deserialized.Last());

            Assert.IsNull(TagCollection.FromString(null));
        }
Exemplo n.º 2
0
        private Arguments Generate(TagCollection tags, string startTag = "", string endTag = "", string fileExtension = ".sql", string fileName = "updated-sql.csv")
        {
            var start = tags.FirstOrDefault(x => x.Name == startTag);
            var end = tags.FirstOrDefault(x => x.Name == endTag);

            return new Arguments
            {
                StartTag = start != null ? start.Target.Sha : tags.Last().Target.Sha,
                EndTag = end != null ? end.Target.Sha : tags.Reverse().Skip(1).First().Target.Sha,
                FileExtension = fileExtension,
                ExportFileName = fileName
            };
        }