예제 #1
0
        /// <summary>
        /// Helper method to read the conversation from <paramref name="inputFilePath"/>.
        /// </summary>
        /// <param name="inputFilePath">
        /// The input file path.
        /// </param>
        /// <returns>
        /// A <see cref="Conversation"/> model representing the conversation.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// Thrown when the input file could not be found.
        /// </exception>
        /// <exception cref="Exception">
        /// Thrown when something else went wrong.
        /// </exception>
        public void ExportConversation(string inputFilePath, string outputFilePath)
        {
            Conversation conversation = readController.ReadConversation(inputFilePath);

            if (filterController.FiltersToApply)
            {
                conversation = filterController.FilterConversation(conversation);
            }

            conversation = reportController.GenerateReport(conversation);

            writeController.WriteConversation(conversation, outputFilePath);

            Console.WriteLine("Conversation exported from '{0}' to '{1}'", inputFilePath, outputFilePath);
        }
        public void ReportControllerReportsData()
        {
            // INITIALISE reportController variable
            reportController = new ReportController();
            // CALL MakeConversation method
            MakeConverSation();
            // GenerateReport passing in the conversation
            conversation = reportController.GenerateReport(conversation);

            Assert.That(conversation.Report.mostActiveUser, Is.EqualTo("angus"));

            Assert.That(conversation.Report.userActivityRanking[0], Is.EqualTo("Rank 1 is angus with 4 messages"));
            Assert.That(conversation.Report.userActivityRanking[1], Is.EqualTo("Rank 2 is bob with 3 messages"));
            Assert.That(conversation.Report.userActivityRanking[2], Is.EqualTo("Rank 3 is mike with 2 messages"));
        }
 public void Execute(IProgressMonitor progressMonitor)
 {
     testController.ReadReport(report => reportController.GenerateReport(report,
                                                                         ReportOptions, progressMonitor));
 }