public void ManagedObjectBlobs_WhenBlobAssetReferenceIsNull() { var a = new ClassWithBlobAssetReference(); var managedObjectBlobs = new ManagedObjectBlobs(); using (var blobAssets = new NativeList <BlobAssetPtr>(1, Allocator.Temp)) using (var blobAssetsMap = new NativeHashMap <BlobAssetPtr, int>(1, Allocator.Temp)) { managedObjectBlobs.GatherBlobAssetReferences(a, blobAssets, blobAssetsMap); Assert.That(blobAssets.Length, Is.EqualTo(0)); Assert.That(blobAssetsMap.Count(), Is.EqualTo(0)); } }
public void ManagedObjectClone_ClassWithBlobAssetReference() { using (var blobAssetReference = BlobAssetReference <int> .Create(13)) { var src = new ClassWithBlobAssetReference { BlobAssetReference = blobAssetReference }; var dst = new ManagedObjectClone().Clone(src) as ClassWithBlobAssetReference; Assert.That(dst, Is.Not.Null); Assert.That(dst, Is.Not.SameAs(src)); Assert.That(dst.BlobAssetReference.Value, Is.EqualTo(13)); } }