예제 #1
0
        public void Serializable()
        {
            var source = new EventRaisingCollectionDataDecorator(new SerializableDomainObjectCollectionEventRaiserFake(), new DomainObjectCollectionData());

            source.Insert(0, _order1);
            source.Insert(1, _order3);
            source.Insert(2, _order4);

            var result = Serializer.SerializeAndDeserialize(source);

            Assert.That(result.Count, Is.EqualTo(3));
        }
예제 #2
0
        public override void SetUp()
        {
            base.SetUp();

            _mockRepository  = new MockRepository();
            _eventRaiserMock = _mockRepository.StrictMock <IDomainObjectCollectionEventRaiser> ();

            _order1 = DomainObjectIDs.Order1.GetObject <Order> ();
            _order3 = DomainObjectIDs.Order3.GetObject <Order> ();
            _order4 = DomainObjectIDs.Order4.GetObject <Order> ();
            _order5 = DomainObjectIDs.Order5.GetObject <Order> ();

            var realContent = new DomainObjectCollectionData(new[] { _order1, _order3, _order4 });

            _eventRaisingDecoratorWithRealContent = new EventRaisingCollectionDataDecorator(_eventRaiserMock, realContent);

            _eventRaiserMock.BackToRecord();
            _eventRaiserMock.Replay();
        }