private void ReadMonoBehaviours(PrefabMetadata metadata, string content)
        {
            var documents = content.Split(new string[] { "--- !u!114" }, StringSplitOptions.RemoveEmptyEntries);

            for (int i = 1; i < documents.Length; i++)
            {
                var document      = documents[i];
                var monoBehaviour = new MonoBehaviourMetadata();
                var script        = new ScriptMetadata
                {
                    FileId = ReadFileId(document, ScriptFileIdRegex),
                    Guid   = ReadString(document, ScriptGuidRegex, "guid")
                };
                script.FullName = m_scriptMetadataService.GetFullNameByFileId(script.FileId);

                if (String.IsNullOrEmpty(script.FullName))
                {
                    script.FullName = MetaFileService.GetFileNameByGuid(script.Guid);
                }

                monoBehaviour.Script = script;

                metadata.MonoBehaviours.Add(monoBehaviour);
            }
        }
        public void FixMissingMonobehaviours_Prefab_PrefabMetadataUpdated()
        {
            var prefab = new PrefabMetadata();

            prefab.Path = "Prefab1.prefab";

            var missingMonoBehaviours = new MonoBehaviourMetadata[]
            {
                new MonoBehaviourMetadata {
                    Script = new ScriptMetadata {
                        FileId = 1, FullName = "System.String"
                    }
                },
                new MonoBehaviourMetadata {
                    Script = new ScriptMetadata {
                        FileId = 3, FullName = "System.DateTime"
                    }
                },
            };

            m_prefabMetadataWriter.Expect(w => w.ReplaceGuid(missingMonoBehaviours.First().Script, "1.2", "Prefab1.prefab"));
            m_prefabMetadataWriter.Expect(w => w.ReplaceGuid(missingMonoBehaviours.Last().Script, "3.2", "Prefab1.prefab"));

            m_typeService.Expect(t => t.GetTypeByName("System.String")).Return(typeof(string));
            m_typeService.Expect(t => t.GetTypeByName("System.DateTime")).Return(typeof(DateTime));
            m_typeService.Expect(t => t.GetGuid(typeof(string))).Return("1.2");
            m_typeService.Expect(t => t.GetGuid(typeof(DateTime))).Return("3.2");

            m_target.FixMissingMonobehaviours(prefab, missingMonoBehaviours);

            m_prefabMetadataWriter.VerifyAllExpectations();
        }