/// <summary>
 /// Send the necessary messages about a <see cref="Thing"/>s type (and all supertpes) being changed.
 /// </summary>
 /// <param name="thing">
 /// The <see cref="Thing"/> that has changed.
 /// </param>
 /// <param name="eventKind">
 /// The event kind.
 /// </param>
 private void SendTypedObjectChangeEvent(Thing thing, EventKind eventKind)
 {
     foreach (var type in TypeResolver.GetAllSuperTypes(thing))
     {
         this.SendMessage(new ObjectChangedEvent(thing, eventKind), type);
     }
 }
Exemple #2
0
        public void Verify_that_GetAllSuperTypes_returns_expected_result()
        {
            var category = new Category();

            var superTypes = TypeResolver.GetAllSuperTypes(category).ToList();

            var expectedTypes = new List <Type>()
            {
                typeof(Category), typeof(DefinedThing), typeof(Thing)
            };

            CollectionAssert.AreEquivalent(expectedTypes, superTypes);
        }