public void EntityCommandBufferConcurrent_DisposeDuringWrite_ThrowsInvalidOperation()
        {
            EntityCommandBuffer cmds         = new EntityCommandBuffer(Allocator.TempJob);
            const int           kCreateCount = 10000;
            var job = new TestParallelJob
            {
                CommandBuffer = cmds.ToConcurrent(),
            }.Schedule(kCreateCount, 64);

            Assert.Throws <InvalidOperationException>(() => { cmds.Dispose(); });
            job.Complete();
            cmds.Dispose();
        }
        public void BarrierSystem_OmitAddJobHandleForProducer_ThrowArgumentException()
        {
            var       barrier      = World.GetOrCreateManager <EndFrameBarrier>();
            var       cmds         = barrier.CreateCommandBuffer();
            const int kCreateCount = 10000;
            var       job          = new TestParallelJob
            {
                CommandBuffer = cmds.ToConcurrent(),
            }.Schedule(kCreateCount, 64);

            // Should call barrier.AddJobHandleForProducer() here to prevent this exception.
            Assert.Throws <ArgumentException>(() => { barrier.Update(); });
            job.Complete();
            cmds.Dispose();
        }