Exemplo n.º 1
0
        public void Blob_FiresTheContentStatusChangedEventAfterItGoesFromAnIBlobToNull(Type blobType)
        {
            IBlob mockBlob = RecorderManager.CreateMockedObject(blobType) as IBlob;;

            HelperForBackingStores helper = new HelperForBackingStores();
            _backer.StoreStatusChanged += new StatusChangeEventHandler<IBackingStore, StoreStatusChangeEventArgs>(helper.StoreStatusChanged_DummyHandler);

            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                recorder.ExpectAndReturn(_backer.GetBlob(), mockBlob);
                new StoreStatusChangeEventArgs(BackingStoreStatus.Available, BackingStoreStatus.UnAvailable);
                recorder.CheckArguments();
                helper.StoreStatusChanged_DummyHandler(_backer, null);
                _backer.Log(null, null);
            }

            _backer.BlobObj = null;

            MockManager.Verify();
        }
Exemplo n.º 2
0
        public void Clear_FiresTheContentStatusChangingEventBeforeItGoesFromAnINetworkObjToNull()
        {
            INetwork mockObj = RecorderManager.CreateMockedObject<INetwork>();

            HelperForBackingStores helper = new HelperForBackingStores();
            _backer.StoreStatusChanging += new StatusChangeEventHandler<IBackingStore, StoreStatusChangeEventArgs>(helper.StoreStatusChanging_DummyHandler);

            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                new StoreStatusChangeEventArgs(BackingStoreStatus.Available, BackingStoreStatus.UnAvailable);
                recorder.CheckArguments();
                helper.StoreStatusChanging_DummyHandler(_backer, null);
                _backer.Log(null, null);
            }

            _backer.SetNetwork(mockObj);
            _backer.Clear();

            MockManager.Verify();
        }
Exemplo n.º 3
0
        public void Clear_FiresTheContentStatusChangedEventAfterItGoesFromAnIDataObjToNull()
        {
            IFrame mockObj = RecorderManager.CreateMockedObject<IFrame>();

            HelperForBackingStores helper = new HelperForBackingStores();
            _backer.StoreStatusChanged += new StatusChangeEventHandler<IBackingStore, StoreStatusChangeEventArgs>(helper.StoreStatusChanged_DummyHandler);

            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                new StoreStatusChangeEventArgs(BackingStoreStatus.Available, BackingStoreStatus.UnAvailable);
                recorder.CheckArguments();
                helper.StoreStatusChanged_DummyHandler(_backer, null);
                _backer.Log(null, null);
                recorder.Repeat(1);
            }

            _backer.SetData(mockObj);
            _backer.Clear();

            MockManager.Verify();
        }
Exemplo n.º 4
0
        public void NetworkObj_FiresTheStoreStatusChangingEventBeforeItGoesFromNullToAnINetworkObj()
        {
            INetwork mockObj = RecorderManager.CreateMockedObject<INetwork>();

            HelperForBackingStores helper = new HelperForBackingStores();
            _backer.StoreStatusChanging += new StatusChangeEventHandler<IBackingStore, StoreStatusChangeEventArgs>(helper.StoreStatusChanging_DummyHandler);
            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                recorder.ExpectAndReturn(_backer.GetNetwork(), null);
                new StoreStatusChangeEventArgs(BackingStoreStatus.UnAvailable, BackingStoreStatus.Available);
                recorder.CheckArguments();
                helper.StoreStatusChanging_DummyHandler(_backer, null);
                _backer.Log(null, null);
            }

            _backer.NetworkObj = mockObj;

            MockManager.Verify();
        }
Exemplo n.º 5
0
        public void DataObj_FiresTheStoreStatusChangedEventAfterItGoesFromNullToAnIDataObj()
        {
            IFrame mockObj = RecorderManager.CreateMockedObject<IFrame>();

            HelperForBackingStores helper = new HelperForBackingStores();
            _backer.StoreStatusChanged += new StatusChangeEventHandler<IBackingStore, StoreStatusChangeEventArgs>(helper.StoreStatusChanged_DummyHandler);
            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                recorder.ExpectAndReturn(_backer.GetData(), null);
                new StoreStatusChangeEventArgs(BackingStoreStatus.UnAvailable, BackingStoreStatus.Available);
                recorder.CheckArguments();
                helper.StoreStatusChanged_DummyHandler(_backer, null);
                _backer.Log(null, null);
            }

            _backer.DataObj = mockObj;

            MockManager.Verify();
        }