private static string GetMergeRequestState(string state, string createdAt, string updatedAt) { string result = DateComparer.DateStringsMatch(createdAt, updatedAt) //they might differ by 1 second ? state : string.Equals(state, GitlabKeys.StateOpened, StringComparison.InvariantCultureIgnoreCase) ? "updated" : state; return(result); }
private static string GetCommentAction(string createdAt, string updatedAt) { return(DateComparer.DateStringsMatch(createdAt, updatedAt) ? "commented" : "updated the comment"); }
public void Test_DateStringsMatch_Functional(string date1, string date2, bool expectedResult) { bool result = DateComparer.DateStringsMatch(date1, date2); Assert.Equal(expectedResult, result); }