コード例 #1
0
ファイル: TestSerializer.cs プロジェクト: cg123/xenko
        public unsafe void TestLoadMissingAsset()
        {
            var assetManager = new AssetManager();
            var asset = assetManager.Load<SimpleAsset>("inexisting/asset");
            Assert.That(asset, Is.Null);
            Assert.That(assetManager.HasAssetWithUrl("inexisting/asset"), Is.False);

            SaveAssetsAndDeleteAChild(assetManager);
            GC.Collect();

            asset = assetManager.Load<SimpleAsset>("SimpleAssets/Pa");
            Assert.That(asset, !Is.Null);
            Assert.That(asset.Url, Is.EqualTo("SimpleAssets/Pa"));
            Assert.That(asset.Child, Is.Null);

            asset = assetManager.Load<SimpleAsset>("SimpleAssets/Son");
            Assert.That(asset, Is.Null);
        }