public void ClearConfiguration_WithFailedLayerInitializationAndExpectingRecreation_ConfigurationClearedButKeepFailedFlagSet()
        {
            // Setup
            using (var layerStatus = new WmtsBackgroundLayerStatus())
            {
                WmtsMapData mapData = WmtsMapDataTestHelper.CreateDefaultPdokMapData();
                layerStatus.LayerInitializationFailed();

                // Call
                layerStatus.ClearConfiguration(true);

                // Assert
                Assert.IsTrue(layerStatus.PreviousBackgroundLayerCreationFailed);
                Assert.IsFalse(layerStatus.HasSameConfiguration(mapData));
            }
        }
        public void ClearConfiguration_HasLayer_ConfigurationCleared()
        {
            // 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 WmtsBackgroundLayerStatus())
                {
                    WmtsMapData mapData = WmtsMapDataTestHelper.CreateDefaultPdokMapData();
                    layerStatus.LayerInitializationSuccessful(layer, mapData);

                    // Call
                    layerStatus.ClearConfiguration();

                    // Assert
                    Assert.IsFalse(layerStatus.PreviousBackgroundLayerCreationFailed);
                    Assert.IsFalse(layerStatus.HasSameConfiguration(mapData));
                }
        }