public void TestRemovingDeadObject()
        {
            var objects = new HashSet <SampleTemporaryObject>();
            var temp    = new SampleTemporaryObject(1, objects);

            objects.Add(temp);
            TemporaryObjectsManager.AddTemporaryObject(temp);
            TemporaryObjectsManager.UpdateTemporaryObjects();
            Assert.IsEmpty(objects);
        }
        public void TestRemovingOnlyDeadObjects()
        {
            var objects = new HashSet <SampleTemporaryObject>();
            var first   = new SampleTemporaryObject(1, objects);
            var second  = new SampleTemporaryObject(2, objects);

            objects.Add(first);
            objects.Add(second);
            TemporaryObjectsManager.AddTemporaryObject(first);
            TemporaryObjectsManager.AddTemporaryObject(second);
            TemporaryObjectsManager.UpdateTemporaryObjects();
            Assert.IsNotEmpty(objects);
        }