public static TestArchetypesRun PrepareAbstractDictionaryAdd()
        {
            var asset = new Types.MyAsset6 { MyDictionary = { { "Key1", new Types.SomeObject { Value = "String1" } }, { "Key2", new Types.SomeObject2 { Value = "String2" } } } };
            var context = DeriveAssetTest<Types.MyAsset6>.DeriveAsset(asset);
            var baseIds = CollectionItemIdHelper.GetCollectionItemIds(asset.MyDictionary);
            var derivedIds = CollectionItemIdHelper.GetCollectionItemIds(context.DerivedAsset.MyDictionary);
            var basePropertyNode = (AssetNode)((IGraphNode)context.BaseGraph.RootNode).TryGetChild(nameof(Types.MyAsset6.MyDictionary));
            var derivedPropertyNode = (AssetNode)((IGraphNode)context.DerivedGraph.RootNode).TryGetChild(nameof(Types.MyAsset6.MyDictionary));

            var objB0 = asset.MyDictionary["Key1"];
            var objB1 = asset.MyDictionary["Key2"];
            var objD0 = context.DerivedAsset.MyDictionary["Key1"];
            var objD1 = context.DerivedAsset.MyDictionary["Key2"];
            var newObjD = new Types.SomeObject { Value = "String3" };
            var newObjB = new Types.SomeObject2 { Value = "String4" };

            var test = new TestArchetypesRun(context)
            {
                InitialCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyDictionary.Count);
                    Assert.AreEqual(2, context.DerivedAsset.MyDictionary.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(objB1, basePropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual(objD0, derivedPropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual("String1", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("String1", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(2, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds["Key1"], derivedIds["Key1"]);
                    Assert.AreEqual(baseIds["Key2"], derivedIds["Key2"]);
                },
                FirstChange = () =>
                {
                    derivedPropertyNode.Content.Add(newObjD, new Index("Key3"));
                },
                FirstChangeCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyDictionary.Count);
                    Assert.AreEqual(3, context.DerivedAsset.MyDictionary.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(objB1, basePropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual(objD0, derivedPropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual(newObjD, derivedPropertyNode.Content.Retrieve(new Index("Key3")));
                    Assert.AreEqual("String1", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("String1", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("String3", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key3"))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.New, derivedPropertyNode.GetItemOverride(new Index("Key3")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key3")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(1, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(3, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds["Key1"], derivedIds["Key1"]);
                    Assert.AreEqual(baseIds["Key2"], derivedIds["Key2"]);
                },
                SecondChange = () =>
                {
                    basePropertyNode.Content.Add(newObjB, new Index("Key4"));
                },
                SecondChangeCheck = () =>
                {
                    Assert.AreEqual(3, context.BaseAsset.MyDictionary.Count);
                    Assert.AreEqual(4, context.DerivedAsset.MyDictionary.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(objB1, basePropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual(newObjB, basePropertyNode.Content.Retrieve(new Index("Key4")));
                    Assert.AreEqual(objD0, derivedPropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreNotEqual(newObjB, derivedPropertyNode.Content.Retrieve(new Index("Key4")));
                    Assert.AreEqual(newObjD, derivedPropertyNode.Content.Retrieve(new Index("Key3")));
                    Assert.AreEqual("String1", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("String4", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key4"))).Value);
                    Assert.AreEqual("String1", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("String4", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key4"))).Value);
                    Assert.AreEqual("String3", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key3"))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key4")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.New, derivedPropertyNode.GetItemOverride(new Index("Key3")));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key4")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key3")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key4")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(1, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(3, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(4, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds["Key1"], derivedIds["Key1"]);
                    Assert.AreEqual(baseIds["Key2"], derivedIds["Key2"]);
                    Assert.AreEqual(baseIds["Key4"], derivedIds["Key4"]);
                }
            };
            return test;
        }
        public static TestArchetypesRun PrepareObjectCollectionUpdate()
        {
            var asset = new Types.MyAsset4 { MyObjects = { new Types.SomeObject { Value = "String1" }, new Types.SomeObject { Value = "String2" } } };
            var context = DeriveAssetTest<Types.MyAsset4>.DeriveAsset(asset);
            var baseIds = CollectionItemIdHelper.GetCollectionItemIds(asset.MyObjects);
            var derivedIds = CollectionItemIdHelper.GetCollectionItemIds(context.DerivedAsset.MyObjects);
            var basePropertyNode = (AssetNode)((IGraphNode)context.BaseGraph.RootNode).TryGetChild(nameof(Types.MyAsset4.MyObjects));
            var derivedPropertyNode = (AssetNode)((IGraphNode)context.DerivedGraph.RootNode).TryGetChild(nameof(Types.MyAsset4.MyObjects));

            var objB0 = asset.MyObjects[0];
            var objB1 = asset.MyObjects[1];
            var objD0 = context.DerivedAsset.MyObjects[0];
            var objD1 = context.DerivedAsset.MyObjects[1];
            var newObjB = new Types.SomeObject { Value = "MyBaseString" };
            var newObjD = new Types.SomeObject { Value = "MyDerivedString" };

            var test = new TestArchetypesRun(context)
            {
                InitialCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyObjects.Count);
                    Assert.AreEqual(2, context.DerivedAsset.MyObjects.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index(0)));
                    Assert.AreEqual(objB1, basePropertyNode.Content.Retrieve(new Index(1)));
                    Assert.AreEqual(objD0, derivedPropertyNode.Content.Retrieve(new Index(0)));
                    Assert.AreEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index(1)));
                    Assert.AreEqual("String1", ((Types.SomeObject)basePropertyNode.Content.Retrieve(new Index(0))).Value);
                    Assert.AreEqual("String2", ((Types.SomeObject)basePropertyNode.Content.Retrieve(new Index(1))).Value);
                    Assert.AreEqual("String1", ((Types.SomeObject)derivedPropertyNode.Content.Retrieve(new Index(0))).Value);
                    Assert.AreEqual("String2", ((Types.SomeObject)derivedPropertyNode.Content.Retrieve(new Index(1))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index(0)));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index(1)));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index(0)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index(1)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index(0)));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index(1)));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index(0)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index(1)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(2, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds[0], derivedIds[0]);
                    Assert.AreEqual(baseIds[1], derivedIds[1]);
                },
                FirstChange = () =>
                {
                    basePropertyNode.Content.Update(newObjB, new Index(1));
                },
                FirstChangeCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyObjects.Count);
                    Assert.AreEqual(2, context.DerivedAsset.MyObjects.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index(0)));
                    Assert.AreEqual(newObjB, basePropertyNode.Content.Retrieve(new Index(1)));
                    Assert.AreEqual(objD0, derivedPropertyNode.Content.Retrieve(new Index(0)));
                    Assert.AreEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index(1)));
                    Assert.AreEqual("String1", ((Types.SomeObject)basePropertyNode.Content.Retrieve(new Index(0))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.SomeObject)basePropertyNode.Content.Retrieve(new Index(1))).Value);
                    Assert.AreEqual("String1", ((Types.SomeObject)derivedPropertyNode.Content.Retrieve(new Index(0))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.SomeObject)derivedPropertyNode.Content.Retrieve(new Index(1))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index(0)));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index(1)));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index(0)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index(1)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index(0)));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index(1)));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index(0)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index(1)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(2, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds[0], derivedIds[0]);
                    Assert.AreEqual(baseIds[1], derivedIds[1]);
                },
                SecondChange = () =>
                {
                    derivedPropertyNode.Content.Update(newObjD, new Index(0));
                },
                SecondChangeCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyObjects.Count);
                    Assert.AreEqual(2, context.DerivedAsset.MyObjects.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index(0)));
                    Assert.AreEqual(newObjB, basePropertyNode.Content.Retrieve(new Index(1)));
                    Assert.AreEqual(newObjD, derivedPropertyNode.Content.Retrieve(new Index(0)));
                    Assert.AreEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index(1)));
                    Assert.AreEqual("String1", ((Types.SomeObject)basePropertyNode.Content.Retrieve(new Index(0))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.SomeObject)basePropertyNode.Content.Retrieve(new Index(1))).Value);
                    Assert.AreEqual("MyDerivedString", ((Types.SomeObject)derivedPropertyNode.Content.Retrieve(new Index(0))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.SomeObject)derivedPropertyNode.Content.Retrieve(new Index(1))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index(0)));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index(1)));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index(0)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index(1)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.New, derivedPropertyNode.GetItemOverride(new Index(0)));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index(1)));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index(0)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index(1)].TargetNode.TryGetChild(nameof(Types.SomeObject.Value))).GetContentOverride());
                    Assert.AreEqual(1, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(2, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds[0], derivedIds[0]);
                    Assert.AreEqual(baseIds[1], derivedIds[1]);
                }
            };
            return test;
        }
        public static TestArchetypesRun PrepareAbstractDictionaryUpdate()
        {
            var asset = new Types.MyAsset6 { MyDictionary = { { "Key1", new Types.SomeObject { Value = "String1" } }, { "Key2", new Types.SomeObject2 { Value = "String2" } } } };
            var context = DeriveAssetTest<Types.MyAsset6>.DeriveAsset(asset);
            var baseIds = CollectionItemIdHelper.GetCollectionItemIds(asset.MyDictionary);
            var derivedIds = CollectionItemIdHelper.GetCollectionItemIds(context.DerivedAsset.MyDictionary);
            var basePropertyNode = (AssetNode)((IGraphNode)context.BaseGraph.RootNode).TryGetChild(nameof(Types.MyAsset6.MyDictionary));
            var derivedPropertyNode = (AssetNode)((IGraphNode)context.DerivedGraph.RootNode).TryGetChild(nameof(Types.MyAsset6.MyDictionary));

            var objB0 = asset.MyDictionary["Key1"];
            var objB1 = asset.MyDictionary["Key2"];
            var objD0 = context.DerivedAsset.MyDictionary["Key1"];
            var objD1 = context.DerivedAsset.MyDictionary["Key2"];
            var newObjB = new Types.SomeObject { Value = "MyBaseString" };
            var newObjD = new Types.SomeObject2 { Value = "MyDerivedString" };

            var test = new TestArchetypesRun(context)
            {
                InitialCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyDictionary.Count);
                    Assert.AreEqual(2, context.DerivedAsset.MyDictionary.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(objB1, basePropertyNode.Content.Retrieve(new Index("Key2")));
                    // NOTE: we're using this code to test undo/redo and in this case, we have different objects in the derived object after undoing due to the fact that the type of the instance has changed
                    //Assert.AreEqual(objD0, derivedPropertyNode.Content.Retrieve(new Index("Key1")));
                    //Assert.AreEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual("String1", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("String1", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("String2", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(2, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds["Key1"], derivedIds["Key1"]);
                    Assert.AreEqual(baseIds["Key2"], derivedIds["Key2"]);
                },
                FirstChange = () =>
                {
                    basePropertyNode.Content.Update(newObjB, new Index("Key2"));
                },
                FirstChangeCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyDictionary.Count);
                    Assert.AreEqual(2, context.DerivedAsset.MyDictionary.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(newObjB, basePropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual(objD0, derivedPropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreNotEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual("String1", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("String1", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(2, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds["Key1"], derivedIds["Key1"]);
                    Assert.AreEqual(baseIds["Key2"], derivedIds["Key2"]);
                },
                SecondChange = () =>
                {
                    derivedPropertyNode.Content.Update(newObjD, new Index("Key1"));
                },
                SecondChangeCheck = () =>
                {
                    Assert.AreEqual(2, context.BaseAsset.MyDictionary.Count);
                    Assert.AreEqual(2, context.DerivedAsset.MyDictionary.Count);
                    Assert.AreEqual(objB0, basePropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreEqual(newObjB, basePropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual(newObjD, derivedPropertyNode.Content.Retrieve(new Index("Key1")));
                    Assert.AreNotEqual(objD1, derivedPropertyNode.Content.Retrieve(new Index("Key2")));
                    Assert.AreEqual("String1", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.IMyInterface)basePropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual("MyDerivedString", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key1"))).Value);
                    Assert.AreEqual("MyBaseString", ((Types.IMyInterface)derivedPropertyNode.Content.Retrieve(new Index("Key2"))).Value);
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, basePropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)basePropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetContentOverride());
                    Assert.AreEqual(OverrideType.New, derivedPropertyNode.GetItemOverride(new Index("Key1")));
                    Assert.AreEqual(OverrideType.Base, derivedPropertyNode.GetItemOverride(new Index("Key2")));
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key1")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(OverrideType.Base, ((AssetNode)derivedPropertyNode.Content.Reference.AsEnumerable[new Index("Key2")].TargetNode.TryGetChild(nameof(Types.IMyInterface.Value))).GetContentOverride());
                    Assert.AreEqual(1, derivedPropertyNode.GetOverriddenItemIndices().Count());
                    Assert.AreEqual(0, derivedPropertyNode.GetOverriddenKeyIndices().Count());
                    Assert.AreNotSame(baseIds, derivedIds);
                    Assert.AreEqual(2, baseIds.KeyCount);
                    Assert.AreEqual(0, baseIds.DeletedCount);
                    Assert.AreEqual(2, derivedIds.KeyCount);
                    Assert.AreEqual(0, derivedIds.DeletedCount);
                    Assert.AreEqual(baseIds["Key1"], derivedIds["Key1"]);
                    Assert.AreEqual(baseIds["Key2"], derivedIds["Key2"]);
                }
            };
            return test;
        }