public void Should_HaveDefaultId()
        {
            var layer = new BubbleLayer();

            Assert.NotEmpty(layer.Id);
            Assert.Equal(LayerType.BubbleLayer, layer.Type);
            Assert.Empty(layer.EventActivationFlags.EnabledEvents);
        }
        public void Should_HaveGivenId()
        {
            const string id    = "id";
            var          layer = new BubbleLayer(id);

            Assert.Equal(id, layer.Id);
            Assert.Equal(LayerType.BubbleLayer, layer.Type);
            Assert.Empty(layer.EventActivationFlags.EnabledEvents);
        }
        public void Should_TriggerLayerAdded()
        {
            var layer     = new BubbleLayer();
            var triggered = false;
            var map       = new Map("id");
            var eventArgs = new MapJsEventArgs {
                Type = "layeradded"
            };

            layer.OnLayerAdded += args => triggered = args.Map == map && args.Type == eventArgs.Type;
            layer.DispatchEvent(map, eventArgs);
            Assert.True(triggered);
        }
        public void Should_TriggerDblClick()
        {
            var layer     = new BubbleLayer();
            var triggered = false;
            var map       = new Map("id");
            var eventArgs = CreateEventArgsForMouseEvent("dblclick");

            layer.OnDblClick += args => {
                triggered = args.Map == map &&
                            args.LayerId == eventArgs.LayerId &&
                            args.Pixel == eventArgs.Pixel &&
                            args.Position == eventArgs.Position &&
                            args.Type == eventArgs.Type;
            };
            layer.DispatchEvent(map, eventArgs);
            Assert.True(triggered);
        }
        public void Should_TriggerTouchStart()
        {
            var layer     = new BubbleLayer();
            var triggered = false;
            var map       = new Map("id");
            var eventArgs = CreateEventArgsForTouchEvent("touchstart");

            layer.OnTouchStart += args => {
                triggered = args.Map == map &&
                            args.LayerId == eventArgs.LayerId &&
                            args.Pixel == eventArgs.Pixel &&
                            args.Position == eventArgs.Position &&
                            args.Pixels == eventArgs.Pixels &&
                            args.Positions == eventArgs.Positions &&
                            args.Type == eventArgs.Type;
            };
            layer.DispatchEvent(map, eventArgs);
            Assert.True(triggered);
        }