public void GetChangeMatch_Correctly_Matches() { Match match1 = ParseGit.GetChangeMatch("4 files changed, 161 insertions(+), 75 deletions(-)"); Match match2 = ParseGit.GetChangeMatch("not a matching string"); Assert.IsTrue(match1.Success); Assert.IsFalse(match2.Success); }
public void GetDateFromMatch_Gets_Correct_Date() { DateTime expectedDate = DateTime.Parse("2020-03-09 13:56:30"); Assert.AreEqual(expectedDate, ParseGit.GetDateFromMatch(dateMatch1)); }
private void parseBadDateMatch() { ParseGit.GetInfoFromMatch(badDateMatch); }
public void GetInfoFromMatch_Can_Parse_Deletions() { Assert.AreEqual(75, ParseGit.GetInfoFromMatch(stats).Deletions); Assert.AreEqual(1, ParseGit.GetInfoFromMatch(noInsertions).Deletions); Assert.AreEqual(0, ParseGit.GetInfoFromMatch(noDeletions).Deletions); }
public void GetInfoFromMatchs_Returns_Correct_File_Changes() { Assert.AreEqual(4, ParseGit.GetInfoFromMatch(stats).Files); Assert.AreEqual(4, ParseGit.GetInfoFromMatch(noDeletions).Files); Assert.AreEqual(4, ParseGit.GetInfoFromMatch(noInsertions).Files); }