public void Read_Works() { // Arrange var args = new DragEventArgs { AltKey = true, Button = 72, Buttons = 61, ClientX = 3.1, ClientY = 4.2, CtrlKey = false, DataTransfer = new() { DropEffect = "effect1", EffectAllowed = "allowed1", Files = new[] { "File1", "File2" }, Items = new[] { new DataTransferItem { Kind = "kind1", Type = "type1," }, new DataTransferItem { Kind = "kind7", Type = "type6," }, }, Types = new[] { "type1", "type2", "type3" }, }, Detail = 7, MetaKey = false, OffsetX = 8.2, OffsetY = 7.1, PageX = 5.6, PageY = 7.8, ScreenX = 0.1, ScreenY = 4.4, ShiftKey = true, }; var jsonElement = GetJsonElement(args); // Act var result = DragEventArgsReader.Read(jsonElement); // Assert MouseEventArgsReaderTest.AssertEqual(args, result); AssertEqual(args.DataTransfer, result.DataTransfer); }
public void Read_Works() { // Arrange var args = new PointerEventArgs { AltKey = false, Button = 72, Buttons = 61, ClientX = 3.1, ClientY = 4.2, CtrlKey = true, PointerId = 17, PointerType = "pointer1", Width = 90.1f, Height = 43.87f, IsPrimary = true, Pressure = 0.8f, TiltX = 1.1f, TiltY = 9.2f, Type = "type2", Detail = 7, MetaKey = true, OffsetX = 8.2, OffsetY = 7.1, PageX = 5.6, PageY = 7.8, ScreenX = 0.1, ScreenY = 4.4, ShiftKey = true, }; var jsonElement = GetJsonElement(args); // Act var result = PointerEventArgsReader.Read(jsonElement); // Assert MouseEventArgsReaderTest.AssertEqual(args, result); Assert.Equal(args.PointerId, result.PointerId); Assert.Equal(args.PointerType, result.PointerType); Assert.Equal(args.Width, result.Width); Assert.Equal(args.Height, result.Height); Assert.Equal(args.IsPrimary, result.IsPrimary); Assert.Equal(args.Pressure, result.Pressure); Assert.Equal(args.TiltX, result.TiltX); Assert.Equal(args.TiltY, result.TiltY); }
public void Read_Works() { // Arrange var args = new WheelEventArgs { AltKey = false, CtrlKey = true, MetaKey = true, ShiftKey = false, Type = "type1", Detail = 789, Button = 7, Buttons = 234, ClientX = 3.2, ClientY = 33.1, DeltaMode = 2, DeltaX = 11.1, DeltaY = 21.2, DeltaZ = 9.1, OffsetX = 7.2, OffsetY = 1.2, PageX = 5.6, PageY = 7.8, ScreenX = 3.56, ScreenY = 8.32, }; var jsonElement = GetJsonElement(args); // Act var result = WheelEventArgsReader.Read(jsonElement); // Assert MouseEventArgsReaderTest.AssertEqual(args, result); Assert.Equal(args.DeltaMode, result.DeltaMode); Assert.Equal(args.DeltaX, result.DeltaX); Assert.Equal(args.DeltaY, result.DeltaY); Assert.Equal(args.DeltaZ, result.DeltaZ); }