コード例 #1
0
        public void Should_HaveDefaultId()
        {
            var layer = new PolygonExtrusionLayer();

            Assert.NotEmpty(layer.Id);
            Assert.Equal(LayerType.PolygonExtrusionLayer, layer.Type);
            Assert.Empty(layer.EventActivationFlags.EnabledEvents);
        }
コード例 #2
0
        public void Should_HaveGivenId()
        {
            const string id    = "id";
            var          layer = new PolygonExtrusionLayer(id);

            Assert.Equal(id, layer.Id);
            Assert.Equal(LayerType.PolygonExtrusionLayer, layer.Type);
            Assert.Empty(layer.EventActivationFlags.EnabledEvents);
        }
コード例 #3
0
        public void Should_TriggerLayerAdded()
        {
            var layer     = new PolygonExtrusionLayer();
            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);
        }
コード例 #4
0
        public void Should_TriggerDblClick()
        {
            var layer     = new PolygonExtrusionLayer();
            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);
        }
コード例 #5
0
        public void Should_TriggerTouchStart()
        {
            var layer     = new PolygonExtrusionLayer();
            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);
        }