Inheritance: Zetbox.DalProvider.Base.DataObjectBaseImpl, ANewObjectClass, IClientObject
        public void ApplyChanges()
        {
            BaseClientDataObjectMockImpl result = new BaseClientDataObjectMockImpl(null);

            obj.SetPrivatePropertyValue<int>("ID", 10);

            obj.ApplyChangesFrom(result);
            Assert.That(result.ID, Is.EqualTo(obj.ID));
            Assert.That(PropertyChangedCalled, Is.True);
        }
        public override void SetUp()
        {
            base.SetUp();

            PropertyChangedCalled = false;

            obj = new BaseClientDataObjectMockImpl(null);
            obj.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(obj_PropertyChanged);
        }
        public void Stream()
        {
            var typeMap = scope.Resolve<TypeMap>();
            using (var ms = new MemoryStream())
            using (var sw = new ZetboxStreamWriter(typeMap, new BinaryWriter(ms)))
            using (var sr = new ZetboxStreamReader(typeMap, new BinaryReader(ms)))
            {
                var ctx = GetContext();

                ctx.Attach(obj);
                obj.ToStream(sw, null, false);

                Assert.That(ms.Length, Is.GreaterThan(0));

                ms.Seek(0, SeekOrigin.Begin);

                var t = sr.ReadSerializableType();
                Assert.That(t.GetSystemType().IsAssignableFrom(typeof(ANewObjectClass)), string.Format("{0} not assignable to {1}", typeof(ANewObjectClass), t));

                BaseClientDataObjectMockImpl result = new BaseClientDataObjectMockImpl(null);
                result.FromStream(sr);

                Assert.That(result.GetType(), Is.EqualTo(obj.GetType()));
                Assert.That(result.ID, Is.EqualTo(obj.ID));
                Assert.That(result.ObjectState, Is.EqualTo(obj.ObjectState));
            }
        }
 public void FromStream_Null_StreamReader()
 {
     using (IZetboxContext ctx = GetContext())
     {
         BaseClientDataObjectMockImpl result = new BaseClientDataObjectMockImpl(null);
         result.FromStream((ZetboxStreamReader)null);
     }
 }