Skip to content

Commit 359ebcf

Browse files
committed
Update README.md and Bottom sheet unit test
1 parent 6dc6e53 commit 359ebcf

File tree

2 files changed

+346
-8
lines changed

2 files changed

+346
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
![NET_MAUI__Toolkit_Banner](https://cdn.syncfusion.com/content/images/maui/maui-toolkit--controls-banner.png)
22

3-
# Syncfusion Toolkit for .NET MAUI
3+
# Syncfusion® Toolkit for .NET MAUI
44

5-
The Syncfusion Toolkit for .NET MAUI is a high-performance collection of UI controls designed to streamline cross-platform app development across Android, iOS, macOS, and Windows. With this toolkit, developers can deliver beautiful, feature-rich applications with minimal effort, cutting down development time while ensuring a seamless and engaging user experience across platforms.
5+
The Syncfusion® Toolkit for .NET MAUI is a high-performance collection of UI controls designed to streamline cross-platform app development across Android, iOS, macOS, and Windows. With this toolkit, developers can deliver beautiful, feature-rich applications with minimal effort, cutting down development time while ensuring a seamless and engaging user experience across platforms.
66

7-
The Syncfusion Toolkit is built with community collaboration in mind, aiming to incorporate user feedback and contributions. It is the perfect companion for developers looking to build engaging cross-platform applications faster and more efficiently using the Syncfusion ecosystem.
7+
The Syncfusion® Toolkit is built with community collaboration in mind, aiming to incorporate user feedback and contributions. It is the perfect companion for developers looking to build engaging cross-platform applications faster and more efficiently using the Syncfusion® ecosystem.
88

99
[![NuGet version](https://img.shields.io/nuget/v/Syncfusion.Maui.Toolkit)](https://www.nuget.org/packages/Syncfusion.Maui.Toolkit)
1010
[![NuGet Downloads](https://img.shields.io/nuget/dt/Syncfusion.Maui.Toolkit)](https://www.nuget.org/stats/packages/Syncfusion.Maui.Toolkit?groupby=Version)
@@ -64,9 +64,9 @@ Alternatively, add it directly in your `.csproj` file:
6464
<PackageReference Include="Syncfusion.Maui.Toolkit" Version="x.x.x" />
6565
```
6666

67-
## Configure Syncfusion Toolkit
67+
## Configure Syncfusion® Toolkit
6868

69-
In order to use the Syncfusion .NET MAUI Toolkit you need to call the extension method in your MauiProgram.cs file as follows:
69+
In order to use the Syncfusion® .NET MAUI Toolkit you need to call the extension method in your MauiProgram.cs file as follows:
7070

7171
**MauiProgram.cs**
7272

@@ -108,7 +108,7 @@ xmlns:toolkit="http://schemas.syncfusion.com/maui/toolkit"
108108

109109
Here’s a quick example to get you started with one of the controls, such as the Cartesian Chart:
110110

111-
The following XAML code demonstrates how to set up a basic `SfCartesianChart` using the Syncfusion MAUI Toolkit. This code snippet should be included in the `MainPage.xaml` file of your MAUI project. It sets up the necessary namespaces, binds the `ViewModel` to the `ContentPage`, and configures the `SfCartesianChart` with `CategoryAxis` for the X-axis and `NumericalAxis` for the Y-axis. The creation of the `ViewModel` will be explained in the following section.
111+
The following XAML code demonstrates how to set up a basic `SfCartesianChart` using the Syncfusion® MAUI Toolkit. This code snippet should be included in the `MainPage.xaml` file of your MAUI project. It sets up the necessary namespaces, binds the `ViewModel` to the `ContentPage`, and configures the `SfCartesianChart` with `CategoryAxis` for the X-axis and `NumericalAxis` for the Y-axis. The creation of the `ViewModel` will be explained in the following section.
112112

113113
**MainPage.xaml**
114114

@@ -242,8 +242,8 @@ See the [Development Guide](./.github/DEVELOPMENT.md) for more details about thi
242242

243243
You can see the full list of contributors [here](https://github.com/syncfusion/maui-toolkit/graphs/contributors)
244244

245-
## About Syncfusion
246-
Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion has more than 29,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.
245+
## About Syncfusion®
246+
Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion® has more than 29,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.
247247

248248
Today, we provide 1800+ components and frameworks for web ([Blazor](https://www.syncfusion.com/blazor-components?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [JavaScript](https://www.syncfusion.com/javascript-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [Angular](https://www.syncfusion.com/angular-ui-components?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [React](https://www.syncfusion.com/react-ui-components?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [Vue](https://www.syncfusion.com/vue-ui-components?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), and [Flutter](https://www.syncfusion.com/flutter-widgets?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget)), mobile ([.NET MAUI](https://www.syncfusion.com/maui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [Xamarin](https://www.syncfusion.com/xamarin-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [Flutter](https://www.syncfusion.com/flutter-widgets?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [UWP](https://www.syncfusion.com/uwp-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [WPF](https://www.syncfusion.com/wpf-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [WinUI](https://www.syncfusion.com/winui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget), [Flutter](https://www.syncfusion.com/flutter-widgets?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget) and [UWP](https://www.syncfusion.com/uwp-ui-controls?utm_source=nuget&utm_medium=listing&utm_campaign=maui-toolkit-nuget)).
249249
___

maui/tests/Syncfusion.Maui.Toolkit.UnitTest/Navigation/SfBottomSheetUnitTests.cs

Lines changed: 338 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
using Microsoft.Maui.Controls.Shapes;
12
using Syncfusion.Maui.Toolkit.BottomSheet;
3+
using Syncfusion.Maui.Toolkit.Helper;
24
using Syncfusion.Maui.Toolkit.Internals;
35
using System.Reflection;
46

@@ -514,6 +516,342 @@ public void OnHandleTouch_ShouldNotHandleWhenSwipingDisabled()
514516

515517
#endregion
516518

519+
#region Private Methods
520+
521+
[Fact]
522+
public void InitializeLayout()
523+
{
524+
InvokePrivateMethod(_bottomSheet, "InitializeLayout");
525+
var bottomSheet = GetPrivateField(_bottomSheet, "_bottomSheet");
526+
var overlayGrid = GetPrivateField(_bottomSheet, "_overlayGrid");
527+
Assert.True(_bottomSheet.Children?.Contains(bottomSheet));
528+
Assert.True(_bottomSheet.Children?.Contains(overlayGrid));
529+
}
530+
531+
[Fact]
532+
public void AddChild()
533+
{
534+
var verticalStackLayout = new VerticalStackLayout()
535+
{
536+
HorizontalOptions = LayoutOptions.Center,
537+
};
538+
539+
var label = new Label()
540+
{
541+
Text = "Bottom Sheet"
542+
};
543+
544+
verticalStackLayout.Children.Add(label);
545+
InvokePrivateMethod(_bottomSheet, "AddChild", [verticalStackLayout]);
546+
Assert.True(_bottomSheet.Children.Contains(verticalStackLayout));
547+
}
548+
549+
[Fact]
550+
public void InitializeOverlayGrid()
551+
{
552+
InvokePrivateMethod(_bottomSheet, "InitializeOverlayGrid");
553+
Grid? overlayGrid = (Grid?)GetPrivateField(_bottomSheet, "_overlayGrid");
554+
Assert.Equal(overlayGrid?.BackgroundColor, Color.FromArgb("#80000000"));
555+
Assert.Equal(overlayGrid?.Opacity, 0.5);
556+
Assert.Equal(overlayGrid?.IsVisible, false);
557+
}
558+
559+
[Fact]
560+
public void InitializeGrabber()
561+
{
562+
InvokePrivateMethod(_bottomSheet, "InitializeGrabber");
563+
Border? grabber = (Border?)GetPrivateField(_bottomSheet, "_grabber");
564+
RoundRectangle? grabberStrokeShape = (RoundRectangle?)GetPrivateField(_bottomSheet, "_grabberStrokeShape");
565+
Assert.Equal(grabber?.StrokeShape, grabberStrokeShape);
566+
}
567+
568+
[Fact]
569+
public void InitializeContentBorder()
570+
{
571+
InvokePrivateMethod(_bottomSheet, "InitializeContentBorder");
572+
Border? contentBorder = (Border?)GetPrivateField(_bottomSheet, "_contentBorder");
573+
Assert.NotNull(contentBorder);
574+
}
575+
576+
[Theory]
577+
[InlineData(0.5, 0.5)]
578+
[InlineData(0, 0.1)]
579+
[InlineData(-0.5, 0.1)]
580+
public void UpdateHalfExpandedRatioProperty(double value, double expectedValue)
581+
{
582+
InvokePrivateMethod(_bottomSheet, "UpdateHalfExpandedRatioProperty", [value]);
583+
double result = _bottomSheet.HalfExpandedRatio;
584+
Assert.Equal(expectedValue, result);
585+
}
586+
587+
[Theory]
588+
[InlineData(0.8, 0.8)]
589+
[InlineData(0, 0.1)]
590+
[InlineData(-0.5, 0.1)]
591+
public void UpdateFullExpandedRatioProperty(double value, double expectedValue)
592+
{
593+
InvokePrivateMethod(_bottomSheet, "UpdateFullExpandedRatioProperty", [value]);
594+
double result = _bottomSheet.FullExpandedRatio;
595+
Assert.Equal(expectedValue, result);
596+
}
597+
598+
[Fact]
599+
public void SetBottomSheetContent()
600+
{
601+
var verticalStackLayout = new VerticalStackLayout()
602+
{
603+
HorizontalOptions = LayoutOptions.Center,
604+
};
605+
606+
var label = new Label()
607+
{
608+
Text = "Bottom Sheet"
609+
};
610+
611+
verticalStackLayout.Children.Add(label);
612+
InvokePrivateMethod(_bottomSheet, "SetBottomSheetContent", [verticalStackLayout]);
613+
SfGrid? grid = (SfGrid?)GetPrivateField(_bottomSheet, "_bottomSheetContent");
614+
SfBorder? content = (SfBorder?)GetPrivateField(_bottomSheet, "_contentBorder");
615+
Assert.NotNull(content);
616+
Assert.True(grid?.Children.Contains(content));
617+
}
618+
619+
[Fact]
620+
public void UpdateState_HalfExpanded()
621+
{
622+
SetPrivateField(_bottomSheet, "_isSheetOpen", true);
623+
_bottomSheet.State = BottomSheetState.HalfExpanded;
624+
var isHalfExpanded = GetPrivateField(_bottomSheet, "_isHalfExpanded");
625+
Assert.Equal(BottomSheetState.HalfExpanded, _bottomSheet.State);
626+
Assert.True((bool?)isHalfExpanded);
627+
}
628+
629+
[Fact]
630+
public void UpdateState_FullExpanded()
631+
{
632+
SetPrivateField(_bottomSheet, "_isSheetOpen", true);
633+
_bottomSheet.State = BottomSheetState.Hidden;
634+
_bottomSheet.AllowedState = BottomSheetAllowedState.FullExpanded;
635+
var isHalfExpanded = GetPrivateField(_bottomSheet, "_isHalfExpanded");
636+
Assert.Equal(BottomSheetState.FullExpanded, _bottomSheet.State);
637+
Assert.False((bool?)isHalfExpanded);
638+
}
639+
640+
[Fact]
641+
public void UpdateState()
642+
{
643+
_bottomSheet.State = BottomSheetState.Hidden;
644+
SetPrivateField(_bottomSheet, "_isSheetOpen", false);
645+
_bottomSheet.AllowedState = BottomSheetAllowedState.HalfExpanded;
646+
var isHalfState = GetPrivateField(_bottomSheet, "_isHalfExpanded");
647+
Assert.Equal(BottomSheetState.Hidden, _bottomSheet.State);
648+
}
649+
650+
[Fact]
651+
public void UpdateBottomSheetBackground()
652+
{
653+
var grid = new SfGrid();
654+
Brush brush = new SolidColorBrush(Colors.Red);
655+
SetPrivateField(_bottomSheet, "_bottomSheetContent", grid);
656+
InvokePrivateMethod(_bottomSheet, "UpdateBottomSheetBackground", [brush]);
657+
View? content = (View?)GetPrivateField(_bottomSheet, "_bottomSheetContent");
658+
Assert.Equal(brush, content?.Background);
659+
}
660+
661+
[Fact]
662+
public void UpdateGrabberBackground()
663+
{
664+
SfBorder border = new SfBorder();
665+
Brush brush = new SolidColorBrush(Colors.Red);
666+
SetPrivateField(_bottomSheet, "_grabber", border);
667+
InvokePrivateMethod(_bottomSheet, "UpdateGrabberBackground", [brush]);
668+
SfBorder? grabber = (SfBorder?)GetPrivateField(_bottomSheet, "_grabber");
669+
Assert.Equal((brush), grabber?.Background);
670+
}
671+
672+
[Theory]
673+
[MemberData(nameof(CornerRadiusData))]
674+
public void UpdateCornerRadius(CornerRadius value, CornerRadius expected)
675+
{
676+
BottomSheetBorder bottomSheetBorder = new BottomSheetBorder(_bottomSheet);
677+
RoundRectangle roundRectangle = new RoundRectangle();
678+
bottomSheetBorder.StrokeShape = roundRectangle;
679+
SetPrivateField(_bottomSheet, "_bottomSheetStrokeShape", roundRectangle);
680+
SetPrivateField(_bottomSheet, "_bottomSheet", bottomSheetBorder);
681+
InvokePrivateMethod(_bottomSheet, "UpdateCornerRadius", [value]);
682+
BottomSheetBorder? resultBottomSheetBorder = (BottomSheetBorder?)GetPrivateField(_bottomSheet, "_bottomSheet");
683+
RoundRectangle? resultRoundRectangle = (RoundRectangle?)GetPrivateField(_bottomSheet, "_bottomSheetStrokeShape");
684+
Assert.Equal(expected, resultRoundRectangle?.CornerRadius);
685+
Assert.Equal(resultRoundRectangle, resultBottomSheetBorder?.StrokeShape);
686+
}
687+
688+
[Theory]
689+
[MemberData(nameof(ContentPaddingData))]
690+
public void UpdatePadding(Thickness value, Thickness expected)
691+
{
692+
SfBorder border = new SfBorder();
693+
SetPrivateField(_bottomSheet, "_contentBorder", border);
694+
InvokePrivateMethod(_bottomSheet, "UpdatePadding", [value]);
695+
SfBorder? resultBorder = (SfBorder?)GetPrivateField(_bottomSheet, "_contentBorder");
696+
Assert.Equal(expected, resultBorder?.Padding);
697+
}
698+
699+
[Theory]
700+
[InlineData(30, 30)]
701+
[InlineData(0, 0)]
702+
[InlineData(-28, 4)]
703+
public void UpdateGrabberHeightProperty(double input, double expected)
704+
{
705+
InvokePrivateMethod(_bottomSheet, "UpdateGrabberHeightProperty", input);
706+
SfBorder? grabber = (SfBorder?)GetPrivateField(_bottomSheet, "_grabber");
707+
var actual = grabber?.HeightRequest;
708+
Assert.Equal(expected, actual);
709+
}
710+
711+
[Theory]
712+
[InlineData(48, 48)]
713+
[InlineData(0, 0)]
714+
[InlineData(-48, 32)]
715+
public void UpdateGrabberWidthProperty(double input, double expected)
716+
{
717+
InvokePrivateMethod(_bottomSheet, "UpdateGrabberWidthProperty", input);
718+
SfBorder? grabber = (SfBorder?)GetPrivateField(_bottomSheet, "_grabber");
719+
var actual = grabber?.WidthRequest;
720+
Assert.Equal(expected, actual);
721+
}
722+
723+
public static IEnumerable<object[]> CornerRadiusGrabber =>
724+
new List<object[]>
725+
{
726+
new object[] { new CornerRadius(5), new CornerRadius(5) },
727+
new object[] { new CornerRadius(0), new CornerRadius(0) },
728+
new object[] { new CornerRadius(10, 5, 10, 5), new CornerRadius(10, 5, 10, 5) },
729+
new object[] { new CornerRadius(15, 0, 5, 10), new CornerRadius(15, 0, 5, 10) },
730+
};
731+
732+
[Theory]
733+
[MemberData(nameof(CornerRadiusGrabber))]
734+
public void UpdateGrabberCornerRadius(CornerRadius input, CornerRadius expected)
735+
{
736+
InvokePrivateMethod(_bottomSheet, "UpdateGrabberCornerRadius", input);
737+
RoundRectangle? strokeShape = (RoundRectangle?)GetPrivateField(_bottomSheet, "_grabberStrokeShape");
738+
SfBorder? grabber = (SfBorder?)GetPrivateField(_bottomSheet, "_grabber");
739+
Assert.Equal(expected, strokeShape?.CornerRadius);
740+
Assert.Equal(grabber?.StrokeShape, strokeShape);
741+
}
742+
743+
[Theory]
744+
[InlineData(220, BottomSheetAllowedState.FullExpanded, BottomSheetState.Collapsed)]
745+
public void HandleFullExpandedState(double swipeDistance, BottomSheetAllowedState input, BottomSheetState expected)
746+
{
747+
double swipeThreshold = 100;
748+
double doubleSwipeThreshold = 2 * swipeThreshold;
749+
var currentState = BottomSheetState.FullExpanded;
750+
_bottomSheet.State = currentState;
751+
_bottomSheet.AllowedState = input;
752+
InvokePrivateMethod(_bottomSheet, "HandleFullExpandedState", swipeDistance, swipeThreshold, doubleSwipeThreshold);
753+
var actual = _bottomSheet.State;
754+
Assert.Equal(expected, actual);
755+
}
756+
757+
[Theory]
758+
[InlineData(-120, BottomSheetAllowedState.All, BottomSheetState.FullExpanded)]
759+
[InlineData(140, BottomSheetAllowedState.HalfExpanded, BottomSheetState.Collapsed)]
760+
public void HandleHalfExpandedState(double swipeDistance, BottomSheetAllowedState input, BottomSheetState expected)
761+
{
762+
double swipeThreshold = 100;
763+
var currentState = BottomSheetState.HalfExpanded;
764+
_bottomSheet.State = currentState;
765+
_bottomSheet.AllowedState = input;
766+
InvokePrivateMethod(_bottomSheet, "HandleHalfExpandedState", swipeDistance, swipeThreshold);
767+
var actual = _bottomSheet.State;
768+
Assert.Equal(expected, actual);
769+
}
770+
771+
[Theory]
772+
[InlineData(-120, BottomSheetAllowedState.HalfExpanded, BottomSheetState.HalfExpanded)]
773+
[InlineData(-160, BottomSheetAllowedState.FullExpanded, BottomSheetState.FullExpanded)]
774+
[InlineData(-80, BottomSheetAllowedState.All, BottomSheetState.Collapsed)]
775+
public void HandleCollapsedState(double swipeDistance, BottomSheetAllowedState input, BottomSheetState expected)
776+
{
777+
double swipeThreshold = 100;
778+
var currentState = BottomSheetState.Collapsed;
779+
_bottomSheet.State = currentState;
780+
_bottomSheet.AllowedState = input;
781+
InvokePrivateMethod(_bottomSheet, "HandleCollapsedState", swipeDistance, swipeThreshold);
782+
var actual = _bottomSheet.State;
783+
Assert.Equal(expected, actual);
784+
}
785+
786+
[Theory]
787+
[InlineData(BottomSheetState.Hidden, BottomSheetState.Collapsed, false)]
788+
[InlineData(BottomSheetState.Hidden, BottomSheetState.HalfExpanded, true)]
789+
[InlineData(BottomSheetState.Hidden, BottomSheetState.FullExpanded, true)]
790+
[InlineData(BottomSheetState.Collapsed, BottomSheetState.HalfExpanded, true)]
791+
[InlineData(BottomSheetState.Collapsed, BottomSheetState.FullExpanded, true)]
792+
[InlineData(BottomSheetState.HalfExpanded, BottomSheetState.Collapsed, false)]
793+
[InlineData(BottomSheetState.HalfExpanded, BottomSheetState.FullExpanded, true)]
794+
[InlineData(BottomSheetState.FullExpanded, BottomSheetState.HalfExpanded, true)]
795+
[InlineData(BottomSheetState.FullExpanded, BottomSheetState.Collapsed, false)]
796+
public void UpdateStateChanged(BottomSheetState oldState, BottomSheetState newState, bool expectedOverlay)
797+
{
798+
_bottomSheet.State = newState;
799+
InvokePrivateMethod(_bottomSheet, "UpdateStateChanged", oldState, newState);
800+
StateChangedEventArgs? eventArgs = (StateChangedEventArgs?)GetPrivateField(_bottomSheet, "_stateChangedEventArgs");
801+
SfGrid? overlay = (SfGrid?)GetPrivateField(_bottomSheet, "_overlayGrid");
802+
Assert.NotEqual(eventArgs?.OldState, eventArgs?.NewState);
803+
Assert.Equal(expectedOverlay, overlay?.IsVisible);
804+
}
805+
806+
[Theory]
807+
[InlineData(true, true)]
808+
[InlineData(false, false)]
809+
public void SetupBottomSheetForShow(bool input, bool expected)
810+
{
811+
_bottomSheet.IsModal = input;
812+
InvokePrivateMethod(_bottomSheet, "SetupBottomSheetForShow");
813+
SfGrid? overlay = (SfGrid?)GetPrivateField(_bottomSheet, "_overlayGrid");
814+
SfBorder? bottomsheet = (SfBorder?)GetPrivateField(_bottomSheet, "_bottomSheet");
815+
Assert.True(bottomsheet?.IsVisible);
816+
Assert.Equal(0, overlay?.Opacity);
817+
Assert.Equal(expected, overlay?.IsVisible);
818+
}
819+
820+
[Fact]
821+
public void GetCollapsedPosition()
822+
{
823+
InvokePrivateMethod(_bottomSheet, "GetCollapsedPosition");
824+
SfGrid? overlay = (SfGrid?)GetPrivateField(_bottomSheet, "_overlayGrid");
825+
Assert.False(overlay?.IsVisible);
826+
}
827+
828+
[Fact]
829+
public void HandleTouchPressed()
830+
{
831+
double initialTouchY = 500;
832+
SetPrivateField(_bottomSheet, "_initialTouchY", initialTouchY);
833+
SetPrivateField(_bottomSheet, "_isPointerPressed", true);
834+
835+
InvokePrivateMethod(_bottomSheet, "HandleTouchReleased", initialTouchY);
836+
837+
Assert.False(Convert.ToBoolean(GetPrivateField(_bottomSheet, "_isPointerPressed")));
838+
}
839+
840+
[Fact]
841+
public void HandleTouchReleased()
842+
{
843+
double initialTouchY = 500;
844+
SetPrivateField(_bottomSheet, "_initialTouchY", initialTouchY);
845+
SetPrivateField(_bottomSheet, "_isPointerPressed", true);
846+
847+
InvokePrivateMethod(_bottomSheet,"HandleTouchReleased", initialTouchY);
848+
849+
Assert.Equal(initialTouchY, GetPrivateField(_bottomSheet, "_endTouchY"));
850+
Assert.False(Convert.ToBoolean(GetPrivateField(_bottomSheet, "_isPointerPressed")));
851+
}
852+
853+
#endregion
854+
517855
#region Events
518856

519857
public static IEnumerable<object[]> StateData =>

0 commit comments

Comments
 (0)