public void Should_TriggerLayerAdded() { var layer = new LineLayer(); 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 LineLayer(); 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 LineLayer(); 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); }