public void DisplayName_ViaImplementation_Overridden()
        {
            var wrapper        = new ClassDerivedFromBindableObjectWithIdentityBaseOverridingDisplayName();
            var implementation = BindableObjectWithIdentityBaseImplementation.Create(wrapper);

            Assert.That(implementation.DisplayName, Is.EqualTo("Overrotten!"));
        }
        public void DisplayName_ViaImplementation_Default()
        {
            var wrapper        = new ClassDerivedFromBindableObjectWithIdentityBase();
            var implementation = BindableObjectWithIdentityBaseImplementation.Create(wrapper);

            Assert.That(implementation.DisplayName, Is.EqualTo(wrapper.BusinessObjectClass.Identifier));
        }
        public void Create()
        {
            var wrapper = new ClassDerivedFromBindableObjectWithIdentityBase();
            var mixin   = BindableObjectWithIdentityBaseImplementation.Create(wrapper);

            Assert.That(mixin.BusinessObjectClass, Is.Not.Null);
            Assert.That(PrivateInvoke.GetNonPublicProperty(mixin, "Target"), Is.SameAs(wrapper));
        }
        public void Deserialization()
        {
            var wrapper          = new ClassDerivedFromBindableObjectWithIdentityBase();
            var mixin            = BindableObjectWithIdentityBaseImplementation.Create(wrapper);
            var deserializedData = Serializer.SerializeAndDeserialize(Tuple.Create(mixin, wrapper));

            Assert.That(deserializedData.Item1.BusinessObjectClass, Is.Not.Null);
            Assert.That(PrivateInvoke.GetNonPublicProperty(deserializedData.Item1, "Target"), Is.SameAs(deserializedData.Item2));
        }
Exemplo n.º 5
0
 protected BindableObjectWithIdentityBase()
 {
     _implementation = BindableObjectWithIdentityBaseImplementation.Create(this);
 }