Beispiel #1
0
        static void Main(string[] args)
        {
            if (args.Count() != 2)
            {
                Console.Out.WriteLine("args count != 2");
                return;
            }

            string project = args[0];
            string gitId   = args[1];

            GitNumberVersionLink.Settings.SqlConnection = Properties.Settings.Default.ConnectionString;

            List <string> errList = new List <string>();

            GitNumberVersionLink.Service.GitIdNumberService gitNumberService = new GitNumberVersionLink.Service.GitIdNumberService();
            int number = gitNumberService.GetNumber(project, gitId, errList);

            if (errList.Count > 0)
            {
                Console.Out.WriteLine(errList);
            }
            else
            {
                Console.Out.WriteLine(number);
            }
        }
Beispiel #2
0
        public void GetNumberTest()
        {
            GitNumberVersionLink.Service.GitIdNumberService gitIdNumberService = new GitNumberVersionLink.Service.GitIdNumberService();
            List <string> errList = new List <string>();
            int           number  = gitIdNumberService.GetNumber("Project 1", "aaa", errList);

            Assert.Zero(errList.Count);
            Assert.AreEqual(1, number);

            number = gitIdNumberService.GetNumber("Project 1", "bbb", errList);
            Assert.Zero(errList.Count);
            Assert.AreEqual(2, number);

            number = gitIdNumberService.GetNumber("Project 1", "aaa", errList);
            Assert.Zero(errList.Count);
            Assert.AreEqual(1, number);

            number = gitIdNumberService.GetNumber("Project 2", "aaa", errList);
            Assert.Zero(errList.Count);
            Assert.AreEqual(1, number);
        }