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); }
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); }
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); }