예제 #1
0
        public void OutputHtmlFileTest()
        {
            List <Node> nodeList = new List <Node>();

            Dictionary <string, string> shellItemProperties = new Dictionary <string, string>();

            shellItemProperties.Add("Size", "0");
            shellItemProperties.Add("Type", "31");
            shellItemProperties.Add("TypeName", "Some Type Name");
            shellItemProperties.Add("Name", "Some Name");
            shellItemProperties.Add("ModifiedDate", "1/1/0001 12:00:00 AM");
            shellItemProperties.Add("AccessedDate", "1/1/0001 12:00:00 AM");
            shellItemProperties.Add("CreationDate", "1/1/0001 12:00:00 AM");
            CsvParsedShellItem ShellItem = new CsvParsedShellItem(shellItemProperties);

            Event     aEvent = new Event("item1", DateTime.Now, ShellItem, "Access");
            InfoBlock block  = new InfoBlock();
            Node      aNode  = new Node(aEvent, block);

            nodeList.Add(aNode);

            if (File.Exists("timeline.html"))
            {
                File.Delete("timeline.html");
            }
            HtmlIO.OutputHtmlFile(nodeList, "timeline.html");
            Assert.IsTrue(File.Exists("timeline.html"));
        }
예제 #2
0
        public void OutputCSVFileTest()
        {
            List <IShellItem>           shellItems          = new List <IShellItem>();
            Dictionary <string, string> shellItemProperties = new Dictionary <string, string>();

            shellItemProperties.Add("Size", "0");
            shellItemProperties.Add("Type", "31");
            shellItemProperties.Add("TypeName", "Some Type Name");
            shellItemProperties.Add("Name", "Some Name");
            shellItemProperties.Add("ModifiedDate", "1/1/0001 12:00:00 AM");
            shellItemProperties.Add("AccessedDate", "1/1/0001 12:00:00 AM");
            shellItemProperties.Add("CreationDate", "1/1/0001 12:00:00 AM");
            CsvParsedShellItem ShellItem = new CsvParsedShellItem(shellItemProperties);

            shellItems.Add(ShellItem);

            if (File.Exists("raw.csv"))
            {
                File.Delete("raw.csv");
            }
            CsvIO.OutputCSVFile(shellItems, "raw.csv");
            Assert.IsTrue(File.Exists("raw.csv"));
        }
예제 #3
0
        public void EventListOutput()
        {
            List <IShellItem>           shellItems          = new List <IShellItem>();
            Dictionary <string, string> shellItemProperties = new Dictionary <string, string>();

            shellItemProperties.Add("Size", "0");
            shellItemProperties.Add("Type", "31");
            shellItemProperties.Add("TypeName", "Some Type Name");
            shellItemProperties.Add("Name", "Some Name");
            shellItemProperties.Add("ModifiedDate", "1/1/2010 12:00:00 AM");
            shellItemProperties.Add("AccessedDate", "2/1/2000 12:00:00 AM");
            shellItemProperties.Add("CreationDate", "1/1/2019 12:00:00 AM");
            shellItemProperties.Add("LastAccessedDate", "1/1/2016 12:00:00 AM");
            CsvParsedShellItem ShellItem = new CsvParsedShellItem(shellItemProperties);

            shellItems.Add(ShellItem);
            List <IEvent> newList = EventParser.GetEvents(shellItems);

            Assert.IsNotNull(newList);
            foreach (var el in newList)
            {
                Assert.AreSame(el.Parent, ShellItem);
            }
        }
예제 #4
0
        public void ExportAndImportCSVWithSpecialCharactersTest()
        {
            // Export
            List <IShellItem>           shellItems          = new List <IShellItem>();
            Dictionary <string, string> shellItemProperties = new Dictionary <string, string>();

            shellItemProperties.Add("Size", "0");
            shellItemProperties.Add("Type", "31");
            shellItemProperties.Add("TypeName", "Some Type Name");
            shellItemProperties.Add("Name", "Some Name, \n \"Name\"");
            shellItemProperties.Add("ModifiedDate", "1/1/0001 12:00:00 AM");
            shellItemProperties.Add("AccessedDate", "1/1/0001 12:00:00 AM");
            shellItemProperties.Add("CreationDate", "1/1/0001 12:00:00 AM");
            CsvParsedShellItem ShellItem = new CsvParsedShellItem(shellItemProperties);

            shellItems.Add(ShellItem);

            if (File.Exists("raw.csv"))
            {
                File.Delete("raw.csv");
            }
            CsvIO.OutputCSVFile(shellItems, "raw.csv");
            Assert.IsTrue(File.Exists("raw.csv"));

            // Import
            List <IShellItem>            importedShellItems = CsvIO.ImportCSVFile("raw.csv");
            IDictionary <string, string> allProperties      = importedShellItems[0].GetAllProperties();

            Assert.IsTrue(allProperties["Size"].Equals("0"));
            Assert.IsTrue(allProperties["Type"].Equals("31"));
            Assert.IsTrue(allProperties["TypeName"].Equals("Some Type Name"));
            Assert.IsTrue(allProperties["Name"].Equals("Some Name, \n \"Name\""));
            Assert.IsTrue(allProperties["ModifiedDate"].Equals("1/1/0001 12:00:00 AM"));
            Assert.IsTrue(allProperties["AccessedDate"].Equals("1/1/0001 12:00:00 AM"));
            Assert.IsTrue(allProperties["CreationDate"].Equals("1/1/0001 12:00:00 AM"));
        }