Example #1
0
        static void Main(string[] args)
        {
            //create the extractor class and set the repo name.
            RepoChecker.ICommitExtractor extractor = new RepoChecker.CommitExtractor();
            extractor.RepoName = "dolot3/GitHubBrowser";

            //create the parser to parse the returned data.
            parser theParser = new parser(extractor);

            //get the list of repos
            List <RepoData> thelist = theParser.GetFormattedValues();

            //crude output.
            Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(thelist));
        }
Example #2
0
        public void GetFormattedValues_Test()
        {
            //Arrange
            List <RepoData> expected;

            Mock <ICommitExtractor> mockExtractor = new Mock <ICommitExtractor>();

            mockExtractor.Setup(m => m.GetCommitsRaw()).Returns(getTestRawValues());

            parser theFormatter = new parser(mockExtractor.Object);

            //act
            expected = theFormatter.GetFormattedValues();

            //assert
            Assert.Equal(3, expected.Count);
            Assert.Equal("dolot3", expected[0].Committer);
            Assert.Equal("Added interface", expected[1].Message);
            Assert.Equal("07/21/2020 14:39:00", expected[2].CommitDate);
        }