public void ReadMetadataDump()
        {
            using (WpfFileManager wpfFileManager = new WpfFileManager(this.samplePhotosFolder + TestPhotos.SchemaXmpTiff))
            {
                MetadataDump metadataDump = new MetadataDump(wpfFileManager.BitmapMetadata);

                // Check total count
                Assert.AreEqual <int>(metadataDump.StringList.Count, 187);
            }
        }
        public void WriteMetadataAndCheckForMetadataLoss()
        {
            JpgPhoto beforePhoto = TestPhotos.Load(TestPhotos.UnitTest3);
            JpgPhoto afterPhoto  = TestPhotos.Load(TestPhotos.UnitTestTemp5);

            // Copy Test file
            File.Copy(beforePhoto.FileFullName, afterPhoto.FileFullName, true);

            // Change date and save
            afterPhoto.Metadata.FotoflyDateLastSave = DateTime.Now.AddTicks(-DateTime.Now.TimeOfDay.Ticks);
            afterPhoto.WriteMetadata();

            MetadataDump beforeDump;
            MetadataDump afterDump;

            using (WpfFileManager wpfFileManager = new WpfFileManager(beforePhoto.FileFullName))
            {
                beforeDump = new MetadataDump(wpfFileManager.BitmapMetadata);
                beforeDump.GenerateStringList();
            }

            using (WpfFileManager wpfFileManager = new WpfFileManager(afterPhoto.FileFullName))
            {
                afterDump = new MetadataDump(wpfFileManager.BitmapMetadata);
                afterDump.GenerateStringList();
            }

            for (int i = 0; i < beforeDump.StringList.Count; i++)
            {
                // Ignore schema changes, edit dates and created software
                if (beforeDump.StringList[i] != afterDump.StringList[i] &&
                    !beforeDump.StringList[i].Contains("DateLastSave") &&
                    !beforeDump.StringList[i].Contains("LastEditDate") &&
                    !beforeDump.StringList[i].Contains("ushort=513") &&
                    !beforeDump.StringList[i].Contains("OffsetSchema"))
                {
                    Assert.Fail("Metadata mismatch " + beforeDump.StringList[i] + " != " + afterDump.StringList[i]);
                }
            }

            if (new FileInfo(afterPhoto.FileFullName).Length > new FileInfo(beforePhoto.FileFullName).Length)
            {
                Assert.Fail("Photo has decreased in size after saving");
            }

            // Clean up
            File.Delete(afterPhoto.FileFullName);
        }