public void WhenForced_ShouldInvokeCallback() { bool success = false; var b = new BeginInitCommandBuffer(TestWorld); b.CreateSingleton(new TestComponentWithData { Index = 5 }); b.NewBuffer += () => success = true; b.ForceNewBuffer(); b.CreateSingleton(new TestComponentWithData { Index = 5 }); Assert.IsTrue(success); }
public void Extension_ShouldCreateSingleton() { var b = new BeginInitCommandBuffer(TestWorld); b.CreateSingleton <TestComponent>(); BufferSystem.Update(); Assert.AreEqual(1, GetSingletonQuery <TestComponent>().CalculateEntityCount()); }
public void Extension_ShouldCreateSingletonWithCorrectData() { var b = new BeginInitCommandBuffer(TestWorld); b.CreateSingleton(new TestComponentWithData { Index = 5 }); BufferSystem.Update(); Assert.AreEqual(5, GetSingletonQuery <TestComponentWithData>().GetSingleton <TestComponentWithData>().Index); }