public void GetPerMonthDataNonSequentialTest() { MockConversation conversation = new MockConversation(); conversation.AddMessage(new TextMessage(109, false, new DateTime(2010, 1, 15), "whatever1", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); conversation.AddMessage(new TextMessage(110, false, new DateTime(2010, 2, 12), "whatever2", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); conversation.AddMessage(new TextMessage(111, false, new DateTime(2010, 1, 8), "whatever3", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); conversation.AddMessage(new TextMessage(112, false, new DateTime(2009, 12, 3), "whatever3", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); GraphDataGenerator generator = new GraphDataGenerator(); List <ITextGraphData> graphDataActual = new List <ITextGraphData>(generator.MessageCountPerUnitTime(conversation, GraphTimeUnit.Month)); List <ITextGraphData> graphDataExpected = new List <ITextGraphData>(); graphDataExpected.Add(new TextGraphData(new DateTime(2009, 12, 1), 1)); graphDataExpected.Add(new TextGraphData(new DateTime(2010, 1, 1), 2)); graphDataExpected.Add(new TextGraphData(new DateTime(2010, 2, 1), 1)); VerifyGraphDataCollectionsEqual(graphDataExpected, graphDataActual); }
public void GetPerMonthDataNonSequentialTest() { MockConversation conversation = new MockConversation(); conversation.AddMessage(new TextMessage(109, false, new DateTime(2010, 1, 15), "whatever1", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); conversation.AddMessage(new TextMessage(110, false, new DateTime(2010, 2, 12), "whatever2", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); conversation.AddMessage(new TextMessage(111, false, new DateTime(2010, 1, 8), "whatever3", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); conversation.AddMessage(new TextMessage(112, false, new DateTime(2009, 12, 3), "whatever3", "12125551424", CountryCallingCodeFinder.CountryAbbreviationUnitedStates)); GraphDataGenerator generator = new GraphDataGenerator(); List<ITextGraphData> graphDataActual = new List<ITextGraphData>(generator.MessageCountPerUnitTime(conversation, GraphTimeUnit.Month)); List<ITextGraphData> graphDataExpected = new List<ITextGraphData>(); graphDataExpected.Add(new TextGraphData(new DateTime(2009, 12, 1), 1)); graphDataExpected.Add(new TextGraphData(new DateTime(2010, 1, 1), 2)); graphDataExpected.Add(new TextGraphData(new DateTime(2010, 2, 1), 1)); VerifyGraphDataCollectionsEqual(graphDataExpected, graphDataActual); }