public void CopyOnWrite_Twice()
        {
            _copyOnWriteData.CopyOnWrite();
            var data1 = DomainObjectCollectionDataTestHelper.GetWrappedData(_copyOnWriteData);

            _copyOnWriteData.CopyOnWrite();
            var data2 = DomainObjectCollectionDataTestHelper.GetWrappedData(_copyOnWriteData);

            Assert.That(data1, Is.SameAs(data2));
        }
Exemple #2
0
        private void CheckOriginalDataNotCopied(ChangeCachingCollectionDataDecorator decorator)
        {
            var originalData = DomainObjectCollectionDataTestHelper.GetWrappedDataAndCheckType <CopyOnWriteDomainObjectCollectionData> (
                decorator.OriginalData);

            var originalDataStore   = DomainObjectCollectionDataTestHelper.GetWrappedData(originalData);
            var observedWrappedData = PrivateInvoke.GetNonPublicField(decorator, "_observedWrappedData");

            Assert.That(originalDataStore, Is.SameAs(observedWrappedData));
        }
        public void GetData()
        {
            var collectionDataStub = MockRepository.GenerateStub <IDomainObjectCollectionData> ();

            _dataManagerMock.Stub(stub => stub.CollectionData).Return(collectionDataStub);

            var result = _loadState.GetData(_collectionEndPointMock);

            Assert.That(result, Is.TypeOf(typeof(ReadOnlyCollectionDataDecorator)));
            var wrappedData = DomainObjectCollectionDataTestHelper.GetWrappedData(result);

            Assert.That(wrappedData, Is.SameAs(collectionDataStub));
        }