Exemplo n.º 1
0
        public void MissingJobCreationDependency()
        {
            var job = new CreateEntityJob();

            job.entities = m_Manager.BeginExclusiveEntityTransaction();

            var jobHandle = job.Schedule();

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

            jobHandle.Complete();
        }
Exemplo n.º 2
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();
        }
Exemplo n.º 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();
        }