public void DeallocateOnJobCompletion_WithRun_WithMultipleChunks_DeallocatesAtEnd()
        {
            m_Manager.CreateEntity(typeof(EcsTestFloatData));
            var c = SupportsDeallocateOnJobCompletion.Create();

            try
            {
                Assert.DoesNotThrow(() => TestSystem.DeallocateOnJobCompletion_WithRun(c));
                Assert.IsTrue(c.HasBeenDisposed(), "Dispose has not been called");
            }
            finally
            {
                c.Release();
            }
        }
        public void DeallocateInsideStructOnJobCompletion_WithRun_DeallocatesAtEnd()
        {
            m_Manager.CreateEntity(typeof(EcsTestFloatData));
            var c = new CanContainDisposedStruct {
                SupportsDeallocateOnJobCompletion = SupportsDeallocateOnJobCompletion.Create()
            };

            try
            {
                Assert.DoesNotThrow(() => TestSystem.DeallocateInsideStructOnJobCompletion_WithRun(c));
                Assert.IsTrue(c.SupportsDeallocateOnJobCompletion.HasBeenDisposed(), "Dispose has not been called for contained struct");
            }
            finally
            {
                c.SupportsDeallocateOnJobCompletion.Release();
            }
        }
 public void DeallocateOnJobCompletion_WithStructuralChanges(SupportsDeallocateOnJobCompletion c)
 {
     Entities.WithStructuralChanges().WithDeallocateOnJobCompletion(c).ForEach((ref EcsTestFloatData _) => { c.CheckCanRead(); }).Run();
 }