Esempio n. 1
0
        public void Clear_Sets_DataObj_To_Null()
        {
            //Arrange
            var backer = new DataBackingStore();
            var mockObj = new Mock<IFrame>();

            backer.SetData(mockObj.Object);
            backer.Clear();

            IFrame actualObj = backer.DataObj;
            Assert.Null(actualObj);
        }
Esempio n. 2
0
        public void Blob_Gets_The_Data_Obj_As_A_Blob()
        {
            //Arrange
            var backer = new DataBackingStore();
            var mockObj = new Mock<IFrame>();

            backer.SetData(mockObj.Object);

            IBlob actualBlob = backer.Blob;

            Assert.NotNull(actualBlob);
            Assert.Same(mockObj.Object, actualBlob);
        }
Esempio n. 3
0
        public IDataBackingStore CreateDataBackingStore(Guid id, BackingStoreType type)
        {
            IDataBackingStore store = null;

            if (type == BackingStoreType.InMemory)
            {
                store = new DataBackingStore(id);
            }
            else
            {
                throw new NotImplementedException(string.Format("BackingStoreType {0} not yet implemented", type));
            }
            return   store;
        }
Esempio n. 4
0
        public void Clear_Fires_The_StoreStatusChanging_Event_Before_It_Goes_From_A_DataObj_To_Null()
        {
            //Arrange
            var backer = new DataBackingStore();
            var mockObj = new Mock<IFrame>();

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

            backer.SetData(mockObj.Object);
            backer.Clear();

            Assert.Equal(1, helper.StoreStatusChanging_TimesCalled);
        }
Esempio n. 5
0
        public void DataObj_Fires_The_StoreStatusChanged_Event_After_It_Goes_From_A_DataObj_To_Another()
        {
            //Arrange
            var backer = new DataBackingStore();
            var mockObj = new Mock<IFrame>();
            var mockObj2 = new Mock<IFrame>();

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

            backer.DataObj = mockObj2.Object;

            Assert.Equal(1, helper.StoreStatusChanged_TimesCalled);
        }
Esempio n. 6
0
 public void Ctor_Default_Creates_Instance()
 {
     //Arrange
     var backer = new DataBackingStore();
     Assert.NotNull(backer);
 }
Esempio n. 7
0
        public void DataObj_Sets_And_Gets_The_DataObj()
        {
            //Arrange
            var backer = new DataBackingStore();
            var mockObj = new Mock<IFrame>();

            backer.DataObj = mockObj.Object;

            IFrame actualObj = backer.DataObj;

            Assert.NotNull(actualObj);
            Assert.Same(mockObj.Object, actualObj);
        }