Beispiel #1
0
        private void btnViewHistory_Click(object sender, EventArgs e)
        {
            string prompt     = "Check a single file to view its update history.";
            bool   isSelected = ForceSingleSelection(prompt);

            if (!isSelected)
            {
                return;
            }

            try {
                ListViewItem row    = MainListView.CheckedItems[0];
                int          fileID = (int)row.Tag;
                TrackedFile  tf     = FileManager.GetFile(fileID);
                if (tf == null)
                {
                    return;
                }
                FormFileAidViewHistory history = new FormFileAidViewHistory(tf);
                history.ShowDialog();
            }
            catch (SqlException) {
                Messenger.ShowDbMsg();
            }
        }
Beispiel #2
0
        private void btnAddReminder_Click(object sender, EventArgs e)
        {
            List <int> fileIDs      = new List <int>();
            var        checkedItems = MainListView.CheckedItems;

            if (checkedItems.Count < 1)
            {
                Messenger.Show("Check at least 1 file to create reminder.", caption);
                return;
            }
            foreach (ListViewItem item in checkedItems)
            {
                int fileID = (int)item.Tag;
                // Check if file already has a reminder
                TrackedFile tf          = FileManager.GetFile(fileID);
                Reminder    rem         = ReminderManager.GetReminder(tf.ReminderID);
                bool        hasReminder = (rem != null && rem.ResolvedOn == new DateTime());
                if (hasReminder)
                {
                    Messenger.Show("One of more of the chosen files already has an existing, unresolved reminder.\n\n"
                                   , caption);
                    return;
                }
                fileIDs.Add(fileID);
            }

            FormFileAidReminder newReminder = new FormFileAidReminder(fileIDs);
            bool wasAdded = (newReminder.ShowDialog() == DialogResult.OK);

            if (wasAdded)
            {
                FillListView();           // Refresh GUI -- Should this really refresh?
            }
        }
        public void ResolveTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null && files.Count >= 2)
            {
                // Get reminder for second file
                TrackedFile file = files[1];

                if (file.ReminderID != -999)
                {
                    Reminder reminder        = file.GetReminder();
                    DateTime defaultDateTime = new DateTime();
                    if (reminder.ResolvedOn == defaultDateTime)
                    {
                        // Verify the reminder for this file is not resolved.
                        Assert.AreEqual(defaultDateTime, reminder.ResolvedOn);

                        // Call reminder Resolve for this reminder to clear
                        // the reminder.
                        reminder.Resolve();


                        // Verify the reminder for this file is resolved.
                        Assert.AreNotEqual(defaultDateTime, reminder.ResolvedOn);
                    }
                }
            }
        }
        public void RemoveMemoTest()
        {
            string defaultMemo = "Description for memo test reminder";
            string removedMemo = "";

            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                TrackedFile file = files[0];

                // Store the current file memo
                string currentMemo = file.FileMemo ?? "";

                // Update the file to default text
                file.UpdateMemo(defaultMemo);

                // Verify file has the default memo text
                Assert.AreEqual(defaultMemo, file.FileMemo);

                // Remove the file memo
                file.RemoveMemo();

                // Verify the file memo has been removed
                Assert.AreEqual(removedMemo, file.FileMemo);

                // Update the file memo to the original memo text
                file.UpdateMemo(currentMemo);

                // Verify the file memo has the original memo text
                Assert.AreEqual(currentMemo, file.FileMemo);
            }
        }
        public void GetFilesTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                // Get reminder for first file
                TrackedFile file     = files[0];
                Reminder    reminder = file.GetReminder();

                // Get the count for all the files that
                // have this reminder.
                int reminderCount = 0;

                foreach (var f in files)
                {
                    if (f.ReminderID == reminder.ReminderID)
                    {
                        reminderCount++;
                    }
                }

                // Call reminder GetFiles for this reminder to get the
                // list of files with this reminder.
                List <TrackedFile> reminderfileList = reminder.GetFiles();

                // Verify the counts are the same
                Assert.AreEqual(reminderCount, reminderfileList.Count);
            }
        }
Beispiel #6
0
        private void btnTrack_Click(object sender, EventArgs e)
        {
            string prompt     = "Check a single inactive file to begin tracking.";
            bool   isSelected = ForceSingleSelection(prompt);

            if (!isSelected)
            {
                return;
            }

            try {
                ListViewItem row    = MainListView.CheckedItems[0];
                int          fileID = (int)row.Tag;
                TrackedFile  tf     = FileManager.GetFile(fileID);
                if (tf == null)
                {
                    return;
                }
                bool wasStarted = tf.StartTracking(); // Will only start if file is inactive / not being tracked
                if (wasStarted)
                {
                    bool wasLogged = LogTrackingStarted(tf);
                    if (!wasLogged)
                    {
                        Messenger.Show("Failed to log tracking event.", caption);
                    }
                    FillListView(); // Refresh GUI
                }
            }
            catch (SqlException) {
                Messenger.ShowDbMsg();
            }
        }
        private async Task TrackFile(BackupFileUploadJob job)
        {
            using (var context = _factory.CreateContext())
            {
                var alreadyTracked = await context.TrackedFiles.Include(f => f.BackupFolder)
                                     .SingleOrDefaultAsync(f => f.FileName == job.LocalFile.FullName);

                if (alreadyTracked != null)
                {
                    context.Attach(alreadyTracked);

                    var version = new TrackedFileVersion(alreadyTracked);
                    await context.TrackedFileVersions.AddAsync(version, _cancellationTokenSource.Token);

                    alreadyTracked.UpdateFromFileInfo(job.LocalFile);
                }
                else // new file
                {
                    var trackedFile = new TrackedFile(job);
                    await context.TrackedFiles.AddAsync(trackedFile, _cancellationTokenSource.Token);
                }

                await context.SaveChangesAsync(_cancellationTokenSource.Token);
            }
        }
        private void btnRemoveFile_Click(object sender, EventArgs e)
        {
            var listitems = ReminderlistView.Items;

            if (listitems == null || listitems.Count == 0)
            {
                return;
            }
            string prompt     = "Select a file to remove from reminder.";
            bool   isSelected = ForceSingleSelection(prompt);

            if (!isSelected)
            {
                return;
            }

            try {
                // Get selected item / row
                var selected = ReminderlistView.SelectedItems;
                if (selected.Count != 1)
                {
                    return;
                }
                ListViewItem row = selected[0];

                // Retrieve tracked file for selected row
                int         fileID = (int)row.Tag;
                TrackedFile tf     = FileManager.GetFile(fileID);
                if (tf == null)
                {
                    return;
                }

                // Confirm user wants to remove file
                string removePrompt = $"Remove {tf.Filename}.{tf.FileExtension} from reminder?";
                bool   wantsRemoved = (Messenger.ShowYesNo(removePrompt, caption) == DialogResult.Yes);
                if (!wantsRemoved)
                {
                    return;
                }

                // remove file from group
                bool wasRemoved = myRem.RemoveFiles(new List <int> {
                    tf.FileID
                });
                if (wasRemoved)
                {
                    LogFileRemoval(myRem, tf);
                    FillListView(); // Refresh GUI
                }
                else
                {
                    Messenger.Show("Unable to remove file from group.", caption);
                }
            }
            catch (SqlException) {
                Messenger.ShowDbMsg();
            }
        }
        private void btnAddFiles_Click(object sender, EventArgs e)
        {
            if (filesToAdd == null || filesToAdd.Count == 0)
            {
                return;
            }
            int nAdded = 0;
            List <TrackedFile> newFiles = new List <TrackedFile>();

            foreach (var file in filesToAdd)
            {
                FileInfo fi = new FileInfo(file);
                if (!fi.Exists)
                {
                    continue;
                }

                bool alreadyInSystem = FileManager.Exists(file);
                if (!alreadyInSystem)
                {
                    TrackedFile newFile = FileManager.AddFile(
                        Path.GetFileNameWithoutExtension(fi.Name),
                        fi.Extension.Substring(1), fi.DirectoryName,
                        (int)fi.Length, fi.CreationTime, fi.LastWriteTime);
                    if (newFile != null)
                    {
                        LogFileAdded(newFile);
                        newFiles.Add(newFile);
                        nAdded++;
                    }
                }
            }
            bool   wantsLink  = chkLinkFiles.Checked;
            string linkResult = null;

            if (wantsLink && nAdded > 1 && newFiles.Count > 1)
            {
                string memo    = txtMemo.Text.Trim();
                var    fileIDs = from file in newFiles
                                 select file.FileID;
                FileLink newLink = LinkManager.AddLink(fileIDs.ToList(), memo);
                if (newLink != null)
                {
                    // Log link creation and each file joined
                    LogLinkCreation(newLink.LinkMemoID, nAdded, memo);
                    LogLinkJoined(newLink, newLink.GetFiles());
                    linkResult = $"\n\nLinked {nAdded} files" +
                                 (string.IsNullOrEmpty(memo) ? "." : $" as '{memo}'.");
                }
            }
            string resultPrompt = $"Added {nAdded} file(s)." +
                                  linkResult;

            Messenger.Show(resultPrompt, caption);
            DialogResult = DialogResult.OK;
            Close();
        }
        private bool LogFileAdded(TrackedFile tf)
        {
            Event ev = new Event();

            ev.EventTypeID = EventTypes.FileAdded;
            ev.FileID      = tf.FileID;
            ev.OccurredOn  = DateTime.Now;
            ev.Description = $"File added manually: {tf.Filename}.{tf.FileExtension}";
            bool wasLogged = Logger.Log(ev);

            return(wasLogged);
        }
Beispiel #11
0
        private bool LogTrackingStarted(TrackedFile tf)
        {
            Event ev = new Event();

            ev.EventTypeID = EventTypes.FileTrackingStarted;
            ev.FileID      = tf.FileID;
            ev.OccurredOn  = DateTime.Now;
            ev.Description = $"Tracking started for {tf.Filename}.{tf.FileExtension}";
            bool wasLogged = Logger.Log(ev);

            return(wasLogged);
        }
        private bool LogFileRemoval(Reminder rem, TrackedFile tf)
        {
            Event ev = new Event();

            ev.EventTypeID = EventTypes.FileReminderSet;
            ev.ReminderID  = rem.ReminderID;
            ev.FileID      = tf.FileID;
            ev.OccurredOn  = DateTime.Now;
            ev.Description = $"File {tf.Filename}.{tf.FileExtension} removed from reminder: {rem.Name}";
            bool wasLogged = Logger.Log(ev);

            return(wasLogged);
        }
Beispiel #13
0
        private bool LogFileRemoval(FileLink link, TrackedFile tf)
        {
            Event ev = new Event();

            ev.EventTypeID = EventTypes.FileLinkLeftGroup;
            ev.LinkID      = link.LinkMemoID;
            ev.FileID      = tf.FileID;
            ev.OccurredOn  = DateTime.Now;
            ev.Description = $"File {tf.Filename}.{tf.FileExtension} removed from group: ID {link.LinkMemoID}, '{link.LinkMemo}'";
            bool wasLogged = Logger.Log(ev);

            return(wasLogged);
        }
Beispiel #14
0
        private void btnViewReminder_Click(object sender, EventArgs e)
        {
            string prompt     = "Check a single file to view its reminder.";
            bool   isSelected = ForceSingleSelection(prompt);

            if (!isSelected)
            {
                return;
            }

            try {
                ListViewItem row         = MainListView.CheckedItems[0];
                bool         hasReminder = (row.SubItems[6].Text == "X"); // Reminder column
                if (!hasReminder)
                {
                    string noReminderPrompt = "Selected file does not have an open, unresolved reminder.";
                    Messenger.Show(noReminderPrompt, caption);
                    return;
                }

                int         fileID = (int)row.Tag;
                TrackedFile tf     = FileManager.GetFile(fileID);
                if (tf == null)
                {
                    return;
                }
                Reminder rem = tf.GetReminder();
                if (rem == null)
                {
                    return;
                }
                FormFileAidViewReminder viewRem = new FormFileAidViewReminder(rem);
                viewRem.ShowDialog();

                // Always refresh gui here because reminder may have been removed
                FillListView();
                // Re-check the selected item if it is still in list
                foreach (ListViewItem item in MainListView.Items)
                {
                    if ((int)item.Tag == fileID)
                    {
                        item.Checked = true;
                    }
                }
            }
            catch (SqlException) {
                Messenger.ShowDbMsg();
            }
        }
        public void GetReminderTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                // Test reminders for first file
                TrackedFile file     = files[0];
                Reminder    reminder = file.GetReminder();

                //Assert for file 1
                Assert.AreEqual(1, reminder.ReminderID);
                Assert.AreEqual("First reminder", reminder.Name);
                Assert.AreEqual("Description for first reminder", reminder.Memo);
            }
        }
        public void GetInfoTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                TrackedFile first        = files[0];
                string      originalName = first.Filename;
                string      newName      = "Something different than what we know it is";
                first.Filename = newName; // only updating the in-memory object; not database
                first.GetInfo();          // refresh object information from database
                string actual = first.Filename;
                Assert.AreNotEqual(newName, actual);
                Assert.AreEqual(originalName, actual);
            }
        }
        public void StartTrackingTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                TrackedFile file = files[0];

                file.StopTracking();

                Assert.AreNotEqual(new DateTime(), file.TrackingDisabledOn);

                file.StartTracking();

                Assert.AreEqual(new DateTime(), file.TrackingDisabledOn);
            }
        }
Beispiel #18
0
        private void btnViewLinks_Click(object sender, EventArgs e)
        {
            string prompt     = "Check a single file to view its links / groups.";
            bool   isSelected = ForceSingleSelection(prompt);

            if (!isSelected)
            {
                return;
            }

            try {
                ListViewItem row      = MainListView.CheckedItems[0];
                bool         hasLinks = (row.SubItems[5].Text != ""); // # Links column
                if (!hasLinks)
                {
                    string noLinksPrompt = "Selected file is not a member of any filelink groups.";
                    Messenger.Show(noLinksPrompt, caption);
                    return;
                }

                int         fileID = (int)row.Tag;
                TrackedFile tf     = FileManager.GetFile(fileID);
                if (tf == null)
                {
                    return;
                }
                List <FileLink>      myLinks  = tf.GetLinks();
                FormFileAidFileLinks linkForm = new FormFileAidFileLinks(myLinks);
                linkForm.ShowDialog();

                // Always refresh gui here because links may have been removed
                FillListView();
                // Re-check the selected item if it is still in list
                foreach (ListViewItem item in MainListView.Items)
                {
                    if ((int)item.Tag == fileID)
                    {
                        item.Checked = true;
                    }
                }
            }
            catch (SqlException) {
                Messenger.ShowDbMsg();
            }
        }
Beispiel #19
0
        public FormFileAidViewHistory(TrackedFile tf)
        {
            InitializeComponent();
            selectedFile = tf;
            StringBuilder fullFilename = new StringBuilder();

            fullFilename.Append(tf.FilePath);
            if (!tf.FilePath.EndsWith("\\"))
            {
                fullFilename.Append("\\");
            }
            fullFilename.Append(tf.Filename);
            fullFilename.Append(".");
            fullFilename.Append(tf.FileExtension);
            lblFilename.Text = fullFilename.ToString();

            FillListView();
        }
        /// <summary>
        /// Invoked when another application wants to open files from this application.
        /// </summary>
        /// <param name="e">Activation data used to coordinate the process with Windows.</param>
        public async void Activate(FileOpenPickerActivatedEventArgs e)
        {
            _fileOpenPickerUI              = e.FileOpenPickerUI;
            _fileOpenPickerUI.FileRemoved += FilePickerUI_FileRemoved;

            DefaultViewModel["CanGoUp"] = false;
            Window.Current.Content      = this;
            Window.Current.Activate();

            // TODO: Set this.DefaultViewModel["Files"] to show a collection of items,
            //       each of which should have bindable Image, Title, and Description

            // Now that the window has been activated, go ahead and load up the files
            var appInstalledLocation = Package.Current.InstalledLocation;
            var filesFolder          = await appInstalledLocation.GetFolderAsync("FileActivation");

            var queryOptions = new QueryOptions(CommonFileQuery.DefaultQuery, new[] { ".wrtbe" });
            var query        = filesFolder.CreateFileQueryWithOptions(queryOptions);
            var files        = await query.GetFilesAsync();

            var filesList = new List <Object>();

            foreach (var file in files)
            {
                var thumbnail = await file.GetThumbnailAsync(ThumbnailMode.ListView);

                if (thumbnail != null)
                {
                    var image = new BitmapImage();
                    image.SetSource(thumbnail);
                    var result = new TrackedFile
                    {
                        Id          = file.FolderRelativeId,
                        Title       = file.Name,
                        Image       = image,
                        StorageFile = file,
                    };
                    filesList.Add(result);
                }
            }

            DefaultViewModel["Files"] = filesList;
        }
Beispiel #21
0
 private void MainListView_SelectedIndexChanged(object sender, EventArgs e)
 {
     try {
         var selected = MainListView.SelectedItems;
         if (selected.Count != 1)
         {
             return;
         }
         ListViewItem row    = selected[0];
         int          fileID = (int)row.Tag;
         TrackedFile  tf     = FileManager.GetFile(fileID);
         if (tf == null)
         {
             return;
         }
         txtMemo.Text = tf.FileMemo;
     }
     catch (SqlException) {
         Messenger.ShowDbMsg();
     }
 }
Beispiel #22
0
 private void FillListView()
 {
     if (selectedIDs == null)
     {
         return;                      // No files to group
     }
     try {
         AddLinklistView.Items.Clear();
         filesToLink.Clear();
         foreach (int id in selectedIDs)
         {
             TrackedFile tf = FileManager.GetFile(id);
             if (tf == null)
             {
                 continue;
             }
             filesToLink.Add(tf);
         }
         if (filesToLink.Count == 0)
         {
             return;                         // No files found
         }
         foreach (var file in filesToLink)
         {
             string[] fileDetails = new string[6];
             fileDetails[0] = file.Filename;
             fileDetails[1] = file.FileExtension;
             fileDetails[2] = file.FilePath;
             fileDetails[3] = file.FileSize.ToString();
             fileDetails[4] = file.ModifiedOn.ToString();
             fileDetails[5] = (file.TrackingDisabledOn > new DateTime()) ? "X" : "";
             ListViewItem row = new ListViewItem(fileDetails);
             row.Tag = file.FileID;
             AddLinklistView.Items.Add(row);
         }
     }
     catch (SqlException) {
         Messenger.ShowDbMsg();
     }
 }
Beispiel #23
0
        public void RemoveMemoTest()
        {
            string defaultMemo = "Description for memo test reminder";
            string removedMemo = "";

            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                // Get reminder for first file
                TrackedFile file = files[0];

                if (file.ReminderID != -999)
                {
                    Reminder reminder = file.GetReminder();

                    // Store reminder memo value
                    string memo = reminder.Memo ?? "";

                    // Update reminder memo value to default text
                    reminder.UpdateMemo(defaultMemo);

                    // Verify reminder has default memo text
                    Assert.AreEqual(defaultMemo, reminder.Memo);

                    // Remove the reminder memo
                    reminder.RemoveMemo();

                    // Verify the reminder memo has been removed
                    Assert.AreEqual(removedMemo, reminder.Memo);

                    // Update reminder memo with the original memo text
                    reminder.UpdateMemo(memo);

                    // Verify the reminder has the original memo text
                    Assert.AreEqual(memo, reminder.Memo);
                }
            }
        }
        public void GetHistoryTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                // File 1 history
                TrackedFile file = files[0];

                List <Event> events = file.GetHistory();
                if (events != null)
                {
                    Assert.AreEqual(1, events.Count);
                    Assert.AreEqual("First file added to system", events[0].Description);

                    // File 2 history
                    file   = files[1];
                    events = file.GetHistory();
                    Assert.IsNull(events);
                }
            }
        }
Beispiel #25
0
        public static bool UpdateInfo(TrackedFile updatedFile)
        {
            if (updatedFile.FileID <= 0)
            {
                return(false);                         // not required but prevents an unnecessary db call
            }
            List <SqlParameter> args = new List <SqlParameter>();

            args.Add(new SqlParameter("@FileID", updatedFile.FileID));
            args.Add(new SqlParameter("@Path", updatedFile.FilePath));
            args.Add(new SqlParameter("@Size", updatedFile.FileSize));
            args.Add(new SqlParameter("@Modified", System.Data.SqlDbType.DateTime));
            args[3].Value = updatedFile.ModifiedOn;
            args.Add(new SqlParameter("@Created", System.Data.SqlDbType.DateTime));
            args[4].Value = updatedFile.CreatedOn;
            string update = "Update TrackedFiles Set dTrackUpdated = GetDate(), " +
                            "sFilePath = @Path, iSizeInBytes = @Size, dFileModified = @Modified, dFileCreated = @Created " +
                            "Where FileID = @FileID And dTrackDeleted Is Null";
            int  modifiedRows = (int)Db.ExecuteNonQuery(update, args.ToArray());
            bool wasUpdated   = (modifiedRows == 1);

            return(wasUpdated);
        }
Beispiel #26
0
        private static void LogFileChange(TrackedFile file, long newLength, DateTime newModifiedDate)
        {
            using (DbModelContainer db = new DbModelContainer())
            {
                db.Database.CommandTimeout = 1800;

                db.TrackedFiles.Attach(file);

                file.Length   = newLength;
                file.LastSeen = newModifiedDate;

                if (file.UpdatesSeen == null || file.UpdatesSeen == 0)
                {
                    file.UpdatesSeen = 1;
                }
                else
                {
                    file.UpdatesSeen = file.UpdatesSeen + 1;
                }

                db.SaveChanges();
            }
        }
Beispiel #27
0
        public void RemoveFilesTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null && files.Count >= 3)
            {
                // Get reminder for third file
                TrackedFile file = files[2];

                if (file.ReminderID != -999)
                {
                    Reminder reminder = file.GetReminder();


                    // Call reminder GetFiles for this reminder to get the
                    // list of files with this reminder.
                    List <TrackedFile> reminderfileList = reminder.GetFiles();

                    // Create an int list containing the third file id to remove the reminder.
                    List <int> removeList = new List <int>()
                    {
                        file.FileID
                    };

                    // Remove the reminder for the files in the remove list.
                    reminder.RemoveFiles(removeList);

                    // Get the list of files assigned the reminder that was removed from the third file.
                    List <TrackedFile> reminderfileListAfterRemove = reminder.GetFiles();

                    // Verify the after remove file count list matches the before remove file
                    // count list minus the number of files in the remove list.
                    Assert.AreEqual(reminderfileListAfterRemove.Count, reminderfileList.Count - removeList.Count);
                }
            }
        }
        public bool CheckIfTracked(string fileID, string platform)
        {
            try
            {
                TrackedFile file  = new TrackedFile(fileID, platform);
                var         check = connection.Get().Get <TrackedFile>(file.FileID);

                if (check != null)
                {
                    System.Diagnostics.Debug.WriteLine("File with id " + fileID + " IS being tracked");
                    return(true);
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("File with id " + fileID + " IS NOT being tracked");
                    return(false);
                }
            }
            catch (MySqlException e)
            {
                System.Diagnostics.Debug.WriteLine(e.Message);
                return(false);
            }
        }
Beispiel #29
0
        public void GetFileTest()
        {
            // Add a test file so at least one trakced file exists
            FileManager.AddFile("Test File", "test", "test", 1000, DateTime.Now, DateTime.Now);

            // Get all files
            List <TrackedFile> trackedFiles = FileManager.GetFiles();

            // Verify there is at least one file
            Assert.IsNotNull(trackedFiles);

            // Store some data for one of the files
            int    fileId   = trackedFiles[0].FileID;
            string fileName = trackedFiles[0].Filename;
            string fileMemo = trackedFiles[0].FileMemo;

            // Get a file by the file id
            TrackedFile file = FileManager.GetFile(fileId);

            // Verify the expected file was returned
            Assert.IsNotNull(file);
            Assert.AreEqual(fileName, file.Filename);
            Assert.AreEqual(fileMemo, file.FileMemo);
        }
        public void UpdateInfoTest()
        {
            List <TrackedFile> files = FileManagerDAL.GetFiles();

            if (files != null)
            {
                // Get one of the files and modify the file name
                TrackedFile first       = files[0];
                string      fileName    = first.Filename;
                string      newFileName = fileName + "TestName";
                first.Filename = newFileName;

                // Verify the filename has been changed for the object
                Assert.AreNotEqual(fileName, first.Filename);
                Assert.AreEqual(newFileName, first.Filename);

                // Update Info for the object
                first.UpdateInfo();

                // Verify info was updated for the object
                Assert.AreEqual(fileName, first.Filename);
                Assert.AreNotEqual(newFileName, first.Filename);
            }
        }