示例#1
0
        public void ConversionIgnoresMissingMonoBehaviour()
        {
            LogAssert.Expect(LogType.Warning, new Regex("missing"));

            var entity = ConvertGameObjectHierarchy(LoadPrefab("Prefab_MissingMB"), MakeDefaultSettings());

            EntitiesAssert.ContainsOnly(m_Manager, EntityMatch.Any(entity));
        }
示例#2
0
        public void SingleGameObject_RecordsCreatingDstEntity()
        {
            var go = CreateGameObject();

            var entity = GameObjectConversionUtility.ConvertGameObjectHierarchy(go, m_Settings);

            EntitiesAssert.ContainsOnly(m_Manager, EntityMatch.Any(entity));

            Assert.That(m_Events, Has.Length.EqualTo(1));
            Assert.That(m_Events.EventsOfType <Entity>(), Is.EqualTo(new[]
                                                                     { JournalDataDebug.Create(go.GetInstanceID(), entity) }));
        }
示例#3
0
        public void ErrorDuringSelfConversion_RecordsError()
        {
            var go = CreateGameObject();

            go.AddComponent <JournalTestAuthoring>().ShouldError = true;

            var entity = GameObjectConversionUtility.ConvertGameObjectHierarchy(go, m_Settings);

            EntitiesAssert.ContainsOnly(m_Manager, EntityMatch.Any(entity));

            Assert.That(m_Events.EventsOfType <LogEventData>(), Is.EqualTo(new[] {
                JournalDataDebug.Create(go.GetInstanceID(), new LogEventData {
                    Type = LogType.Error, Message = "JournalTestAuthoring.Convert error"
                })
            }));

            LogAssert.Expect(LogType.Error, "JournalTestAuthoring.Convert error");
        }