public void MissingJobCreationDependency() { var job = new CreateEntityJob(); job.entities = m_Manager.BeginExclusiveEntityTransaction(); var jobHandle = job.Schedule(); Assert.Throws <InvalidOperationException>(() => { job.Schedule(); }); jobHandle.Complete(); }
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(); }
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(); }