public void HasSameConfiguration_LayerInitializedSameMapDataType_ReturnFalse(ImageBasedMapData mapData1, ImageBasedMapData mapData2) { // Setup var mocks = new MockRepository(); var tileFetcher = mocks.Stub <ITileFetcher>(); IConfiguration configuration = CreateStubConfiguration(mocks, tileFetcher); mocks.ReplayAll(); using (var layerStatus = new MapControlBackgroundLayerStatus()) { using (var layer = new BruTileLayer(configuration)) { layerStatus.LayerInitializationSuccessful(layer, mapData1); // Call bool isSame = layerStatus.HasSameConfiguration(mapData2); // Assert Assert.IsTrue(isSame, "Should recognize same configuration even if instance is not the same."); } } mocks.VerifyAll(); }
public void ClearConfiguration_HasLayer_ConfigurationCleared(ImageBasedMapData mapData) { // Setup var mocks = new MockRepository(); var tileFetcher = mocks.Stub <ITileFetcher>(); IConfiguration configuration = CreateStubConfiguration(mocks, tileFetcher); mocks.ReplayAll(); using (var layer = new BruTileLayer(configuration)) using (var layerStatus = new MapControlBackgroundLayerStatus()) { layerStatus.LayerInitializationSuccessful(layer, mapData); // Call layerStatus.ClearConfiguration(); // Assert Assert.IsFalse(layerStatus.PreviousBackgroundLayerCreationFailed); Assert.IsFalse(layerStatus.HasSameConfiguration(mapData)); } }