Пример #1
0
        public void Clear_Sets_NetworkObj_To_Null()
        {
            //Arrange
            var backer = new NetworkBackingStore();
            var mockObj = new Mock<INetwork>();

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

            INetwork actualObj = backer.NetworkObj;
            Assert.Null(actualObj);
        }
Пример #2
0
        public void Blob_Gets_The_Data_Obj_As_A_Blob()
        {
            //Arrange
            var backer = new NetworkBackingStore();
            var mockObj = new Mock<INetwork>();

            backer.SetNetwork(mockObj.Object);

            IBlob actualBlob = backer.Blob;

            Assert.NotNull(actualBlob);
            Assert.Same(mockObj.Object, actualBlob);
        }
Пример #3
0
 public INetworkBackingStore CreateNetworkBackingStore(Guid id, BackingStoreType type)
 {
     INetworkBackingStore store = null;
     if (type == BackingStoreType.InMemory)
     {
         store = new NetworkBackingStore(id);
     }
     else
     {
         throw new NotImplementedException(string.Format("BackingStoreType {0} not yet implemented", type));
     }
     return store;
 }
Пример #4
0
        public void Clear_Fires_The_StoreStatusChanging_Event_Before_It_Goes_From_A_NetworkObj_To_Null()
        {
            //Arrange
            var backer = new NetworkBackingStore();
            var mockObj = new Mock<INetwork>();

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

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

            Assert.Equal(1, helper.StoreStatusChanging_TimesCalled);
        }
Пример #5
0
        public void NetworkObj_Fires_The_StoreStatusChanged_Event_After_It_Goes_From_A_NetworkObj_To_Another()
        {
            //Arrange
            var backer = new NetworkBackingStore();
            var mockObj = new Mock<INetwork>();
            var mockObj2 = new Mock<INetwork>();

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

            backer.NetworkObj = mockObj2.Object;

            Assert.Equal(1, helper.StoreStatusChanged_TimesCalled);
        }
Пример #6
0
 public void Ctor_Default_Creates_Instance()
 {
     //Arrange
     var backer = new NetworkBackingStore();
     Assert.NotNull(backer);
 }
Пример #7
0
        public void NetworkObj_Sets_And_Gets_The_NetworkObj()
        {
            //Arrange
            var backer = new NetworkBackingStore();
            var mockObj = new Mock<INetwork>();

            backer.NetworkObj = mockObj.Object;

            INetwork actualObj = backer.NetworkObj;

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