Beispiel #1
0
        public void Circular_Reference_Should_Be_Same_Reference()
        {
            InventoryUpdate update = GetObjectGraph();

            var trackable = update.AsTrackable();

            trackable.Should().BeSameAs(trackable.LinkedInventoryUpdate.LinkedToInventoryUpdate);
            trackable.LinkedInventoryUpdate.Should().BeSameAs(trackable.LinkedInventoryUpdate.LinkedToInventoryUpdate.LinkedInventoryUpdate);
        }
Beispiel #2
0
        public void RejectChanges_On_Circular_Reference_Should_Not_Throw_OverflowException()
        {
            InventoryUpdate update = GetObjectGraph();

            var trackable = update.AsTrackable();

            trackable.InventoryUpdateId = 3;

            trackable.Invoking(t => t.CastToIChangeTrackable().RejectChanges()).Should().NotThrow <OverflowException>();
        }
Beispiel #3
0
        public void BeginEdit_On_Circular_Reference_Should_Not_Throw_OverflowException()
        {
            var update0 = new InventoryUpdate
            {
                InventoryUpdateId = 0
            };
            var update1 = new InventoryUpdate
            {
                InventoryUpdateId       = 1,
                LinkedToInventoryUpdate = update0
            };

            update0.LinkedInventoryUpdate = update1;

            var trackable = update0.AsTrackable();

            trackable.Invoking(t => ((System.ComponentModel.IEditableObject)t).BeginEdit()).Should().NotThrow <OverflowException>();
        }
        public void PropertyChanged_On_Circular_Reference_Should_Not_Throw_OverflowException()
        {
            var update0 = new InventoryUpdate
            {
                InventoryUpdateId = 0
            };
            var update1 = new InventoryUpdate
            {
                InventoryUpdateId       = 1,
                LinkedToInventoryUpdate = update0
            };

            update0.LinkedInventoryUpdate = update1;

            var trackable = update0.AsTrackable();

            //read these properties to force event wire up
            _ = trackable.LinkedInventoryUpdate.LinkedToInventoryUpdate;
            trackable.InventoryUpdateId = 3;
        }