Example #1
0
        public void TestVisit()
        {
            var instance = new MyAssetToVisit();

            var ref1 = new Guid("13cbb80e-35d5-4c1b-96da-c1e0acade4ea");
            var ref2 = new Guid("86a0dcd6-9bcb-442f-84b0-65866a5f1cbc");
            var ref3 = new Guid("3d0ba228-c001-4dfa-859c-04179e5cc2c0");
            var ref4 = new Guid("432740f7-133f-48a9-a118-e8955b3bdd60");
            var ids  = new List <Guid>()
            {
                ref1, ref2, ref3, ref4
            };

            ids.Sort();

            instance.MyReference = new AssetReference <Asset>(ref1, "test");
            instance.MyReferences.Add(new AssetReference <Asset>(ref2, "test2"));
            instance.MyAssetDatas.Add("key", new ContentReference <MyAssetData>(ref3, "test3"));
            instance.MyAssetData = new MyAssetData {
                Child = new ContentReference <MyAssetData>(ref4, "test4")
            };

            var visitor = new MyCustomVisitor();

            visitor.Visit(instance);

            visitor.CollectedGuids.Sort();
            Assert.AreEqual(4, visitor.CollectedGuids.Count);
            Assert.AreEqual(ids, visitor.CollectedGuids);
        }
Example #2
0
        public void TestVisit()
        {
            var instance = new MyAssetToVisit();

            var ref1 = new Guid("13cbb80e-35d5-4c1b-96da-c1e0acade4ea");
            var ref2 = new Guid("86a0dcd6-9bcb-442f-84b0-65866a5f1cbc");
            var ref3 = new Guid("3d0ba228-c001-4dfa-859c-04179e5cc2c0");
            var ref4 = new Guid("432740f7-133f-48a9-a118-e8955b3bdd60");
            var ids = new List<Guid>() { ref1, ref2, ref3, ref4 };
            ids.Sort();

            instance.MyReference = new AssetReference<Asset>(ref1, "test");
            instance.MyReferences.Add(new AssetReference<Asset>(ref2, "test2"));
            instance.MyAssetDatas.Add("key" , new ContentReference<MyAssetData>(ref3, "test3"));
            instance.MyAssetData = new MyAssetData { Child = new ContentReference<MyAssetData>(ref4, "test4") };

            var visitor = new MyCustomVisitor();
            visitor.Visit(instance);

            visitor.CollectedGuids.Sort();
            Assert.AreEqual(4, visitor.CollectedGuids.Count);
            Assert.AreEqual(ids, visitor.CollectedGuids);
        }