public void MixinCanAddInterface() { var domainObject = TargetClassForBehavioralMixin.NewObject(); Assert.That(domainObject is IInterfaceAddedByMixin, Is.True); Assert.That(((IInterfaceAddedByMixin)domainObject).GetGreetings(), Is.EqualTo("Hello, my ID is " + domainObject.ID)); }
public void MixinCanOverrideVirtualPropertiesAndMethods() { var instance = TargetClassForBehavioralMixin.NewObject(); instance.Property = "Text"; Assert.That(instance.Property, Is.EqualTo("Text-MixinSetter-MixinGetter")); Assert.That(instance.GetSomething(), Is.EqualTo("Something-MixinMethod")); }
public void DomainObjectsCanBeMixed() { var domainObject = TargetClassForBehavioralMixin.NewObject(); Assert.That(Mixin.Get <NullMixin> (domainObject), Is.Not.Null); }