public async void SetOptionsAsync_Should_ThrowComponentNotAddedToMapExceptionAsync() { var layer = new DummyLayer { }; await Assert.ThrowsAnyAsync <ComponentNotAddedToMapException>(async() => await layer.SetOptionsAsync(options => options.MinZoom = 2)); _jsRuntimeMock.VerifyNoOtherCalls(); Assert.Null(layer.Options); }
public void UnRegister() { IRenderLayer guiLayer = new DummyLayer("gui"); IRenderLayer videoLayer = new DummyLayer("video"); GUILayerManager.RegisterLayer(guiLayer, GUILayerManager.LayerType.Gui); GUILayerManager.RegisterLayer(videoLayer, GUILayerManager.LayerType.Video); GUILayerManager.UnRegisterLayer(guiLayer); Assert.AreEqual(GUILayerManager.GetLayer(GUILayerManager.LayerType.Gui), null); Assert.AreEqual(GUILayerManager.GetLayer(GUILayerManager.LayerType.Video), videoLayer); }
public async void SetOptionsAsync_Should_ThrowLayerOptionsNullExceptionAsync() { var layer = new DummyLayer { _mapJsRuntime = _jsRuntimeMock.Object }; await layer.SetOptionsAsync(options => options.MinZoom = 2); _jsRuntimeMock.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Layer.SetOptions.ToLayerNamespace(), layer.Id, layer.Options), Times.Once); _jsRuntimeMock.VerifyNoOtherCalls(); Assert.Equal(2, layer.Options.MinZoom); }
public void SRID_Winform_ShouldBeBindable() { var layer = new DummyLayer(); layer.SRID = 0; var binding = new Binding("IntProperty", layer, "SRID"); var targetComponent = new BindableComponent(); targetComponent.DataBindings.Add(binding); layer.SRID = 4326; Assert.That(targetComponent.IntProperty, Is.EqualTo(4326), "Binding on Layer.SRID did not work"); }