Beispiel #1
0
        public void Implementation_IsInitialized()
        {
            var instance = new ClassDerivedFromBindableObjectWithIdentityBase();
            var mixin    = (BindableObjectWithIdentityBaseImplementation)PrivateInvoke.GetNonPublicField(instance, "_implementation");

            Assert.That(mixin.BusinessObjectClass, Is.Not.Null);
        }
        public void DisplayName_ViaImplementation_Default()
        {
            var wrapper        = new ClassDerivedFromBindableObjectWithIdentityBase();
            var implementation = BindableObjectWithIdentityBaseImplementation.Create(wrapper);

            Assert.That(implementation.DisplayName, Is.EqualTo(wrapper.BusinessObjectClass.Identifier));
        }
Beispiel #3
0
        public void SetUp()
        {
            _implementationMock = MockRepository.GenerateMock <IBindableObjectWithIdentityBaseImplementation> ();
            _instance           = new ClassDerivedFromBindableObjectWithIdentityBase(_implementationMock);

            _propertyFake            = MockRepository.GenerateMock <IBusinessObjectProperty> ();
            _businessObjectClassFake = MockRepository.GenerateMock <IBusinessObjectClass> ();
        }
        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 UniqueIdentifierViaImplementation()
        {
            var instance = new ClassDerivedFromBindableObjectWithIdentityBase();

            instance.SetUniqueIdentifier("uniqueID");
            var mixin = (BindableObjectWithIdentityMixin)PrivateInvoke.GetNonPublicField(instance, "_implementation");

            Assert.That(mixin.UniqueIdentifier, Is.EqualTo("uniqueID"));
        }
        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));
        }
Beispiel #7
0
        public void CreateImplementation()
        {
            var instance = new ClassDerivedFromBindableObjectWithIdentityBase();

            Assert.That(PrivateInvoke.GetNonPublicField(instance, "_implementation"), Is.InstanceOf(typeof(BindableObjectWithIdentityBaseImplementation)));
        }
Beispiel #8
0
 public void SetUp()
 {
     _instance = new ClassDerivedFromBindableObjectWithIdentityBase();
     _instanceOverridingDisplayName = new ClassDerivedFromBindableObjectWithIdentityBaseOverridingDisplayName();
 }