示例#1
0
        public void CommitAfterNotRegisteredTransactionJobLogsError()
        {
            var job = new CreateEntityJob();

            job.entities = m_Manager.BeginExclusiveEntityTransaction();

            /*var jobHandle =*/ job.Schedule(m_Manager.ExclusiveEntityTransactionDependency);

            // Commit transaction expects an error not exception otherwise errors might occurr after a system has completed...
            LogAssert.Expect(LogType.Error, new Regex("ExclusiveEntityTransaction job has not been registered"));
            m_Manager.EndExclusiveEntityTransaction();
        }
示例#2
0
        public void MissingJobCreationDependency()
        {
            var job = new CreateEntityJob();

            job.entities = m_Manager.BeginExclusiveEntityTransaction();

            var jobHandle = job.Schedule();

            Assert.Throws <InvalidOperationException>(() => { job.Schedule(); });

            jobHandle.Complete();
        }
示例#3
0
        public void CreationJobAndMainThreadNotAllowedInParallel()
        {
            var job = new CreateEntityJob();

            job.entities = m_Manager.BeginExclusiveEntityTransaction();

            var jobHandle = job.Schedule();

            Assert.Throws <InvalidOperationException>(() => { job.entities.CreateEntity(typeof(EcsTestData)); });

            jobHandle.Complete();
        }
        public void CommitAfterNotRegisteredTransactionJobLogsError()
        {
            var job = new CreateEntityJob();

            job.entities = m_Manager.BeginExclusiveEntityTransaction();

            var jobHandle = job.Schedule(m_Manager.ExclusiveEntityTransactionDependency);

            Assert.Throws <InvalidOperationException>(() => m_Manager.EndExclusiveEntityTransaction());

            jobHandle.Complete();

            m_Manager.EndExclusiveEntityTransaction();
        }