public void ShouldInstantiate() { // act WorkItemComment workItemComment = new WorkItemComment(COMMENT_CONTENT0, m_commentDateTime0); // assert Assert.AreEqual(COMMENT_CONTENT0, workItemComment.Title); Assert.AreEqual(m_commentDateTime0, workItemComment.StartTime); Assert.AreEqual(m_commentDateTime0, workItemComment.EndTime); }
public void ShouldReturnZeroWhenComparingTwoWorkItemComments() { // arrange WorkItemComment workItemComment0 = new WorkItemComment(COMMENT_CONTENT0, m_commentDateTime0); WorkItemComment workItemComment1 = new WorkItemComment(COMMENT_CONTENT0, m_commentDateTime0); // act int result = workItemComment0.CompareTo(workItemComment1); // assert Assert.AreEqual(0, result); }
public void ShouldReturnZeroWhenComparingTitleToWorkItemComment() { // arrange const string EXPECTED_TITLE = COMMENT_CONTENT0; WorkItemComment workItemComment0 = new WorkItemComment(COMMENT_CONTENT0, m_commentDateTime0); // act int result = workItemComment0.CompareTo(EXPECTED_TITLE); // assert Assert.AreEqual(0, result); }
/// <summary> /// Adds new comment to work item data. /// </summary> public void AddComment(string content, DateTime startTime) { var comment = new WorkItemComment(content, startTime); Comments.Add(comment); }
public void ShouldSetEndTime() { // arrange DateTime endDateTime = new DateTime(2013, 09, 21); WorkItemComment workItemComment = new WorkItemComment(COMMENT_CONTENT0, m_commentDateTime0); // act workItemComment.SetEndTime(endDateTime); // assert Assert.AreEqual(endDateTime, workItemComment.EndTime); }
/// <summary> /// Compare this instance with other instance. /// </summary> private int CompareToWorkItemComment(WorkItemComment instanceToCompare) { if (Title.CompareTo(instanceToCompare.Title) == 0 && StartTime.CompareTo(instanceToCompare.StartTime) == 0 && EndTime.CompareTo(instanceToCompare.EndTime) == 0 ) { return THE_SAME_VALUE; } return DIFFERENT_VALUE; }