Skip to content

Commit 3c01751

Browse files
committed
default tests added
1 parent 4b5c755 commit 3c01751

File tree

3 files changed

+164
-1
lines changed

3 files changed

+164
-1
lines changed

maui/src/Charts/Series/FastLineSeries.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ namespace Syncfusion.Maui.Toolkit.Charts
1616
/// <para> <b>Data Label - </b> Data labels are used to display values related to a chart segment. To render the data labels, you need to set the <see cref="ChartSeries.ShowDataLabels"/> property as <b>true</b> in <see cref="FastLineSeries"/> class. To customize the chart data labels alignment, placement, and label styles, you need to create an instance of <see cref="CartesianDataLabelSettings"/> and set to the <see cref="CartesianSeries.DataLabelSettings"/> property.</para>
1717
/// <para> <b>Animation - </b> To animate the series, set <b>True</b> to the <see cref="ChartSeries.EnableAnimation"/> property.</para>
1818
/// <para> <b>LegendIcon - </b> To customize the legend icon using the <see cref="ChartSeries.LegendIcon"/> property.</para>
19-
/// <para>The FastLineSeries does not support empty points.</para>
2019
/// </remarks>
2120
/// <example>
2221
/// # [Xaml](#tab/tabid-1)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Syncfusion.Maui.Toolkit.Charts;
2+
3+
namespace Syncfusion.Maui.Toolkit.UnitTest
4+
{
5+
public class DefaultSegmentUnitTest : BaseUnitTest
6+
{
7+
[Fact]
8+
public void FastScatterSegment_InitializesVisualPropertiesCorrectly()
9+
{
10+
var segment = new FastScatterSegment();
11+
Assert.Equal(1f, segment.Opacity);
12+
Assert.Null(segment.Fill);
13+
Assert.Null(segment.Stroke);
14+
Assert.Equal(1d, segment.StrokeWidth);
15+
Assert.True(segment.IsVisible);
16+
Assert.False(segment.HasStroke);
17+
}
18+
19+
[Fact]
20+
public void FastScatterSegment_InitializesDataPropertiesCorrectly()
21+
{
22+
var segment = new FastScatterSegment();
23+
Assert.Null(segment.Series);
24+
Assert.Null(segment.SeriesView);
25+
Assert.Equal(0, segment.Index);
26+
Assert.Null(segment.Item);
27+
Assert.False(segment.Empty);
28+
Assert.True(segment.InVisibleRange);
29+
Assert.False(segment.IsEmpty);
30+
}
31+
}
32+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
using Syncfusion.Maui.Toolkit.Charts;
2+
3+
namespace Syncfusion.Maui.Toolkit.UnitTest
4+
{
5+
public partial class SeriesDefaultTests
6+
{
7+
[Fact]
8+
public void FastScatterSeriesDefaultTests_Part1()
9+
{
10+
var series = new FastScatterSeries();
11+
Assert.NotNull(series.YValues);
12+
Assert.Empty(series.YValues);
13+
Assert.Null(series.YBindingPath);
14+
Assert.Equal(1d, series.StrokeWidth);
15+
}
16+
17+
[Fact]
18+
public void FastScatterSeriesDefaultTests_Part2()
19+
{
20+
var series = new FastScatterSeries();
21+
Assert.Null(series.ActualXAxis);
22+
Assert.Null(series.ActualYAxis);
23+
Assert.Equal(string.Empty, series.Label);
24+
Assert.True(series.ShowTrackballLabel);
25+
Assert.Null(series.TrackballLabelTemplate);
26+
Assert.Null(series.XAxisName);
27+
Assert.Null(series.YAxisName);
28+
}
29+
30+
[Fact]
31+
public void FastScatterSeriesDefaultTests_Part3()
32+
{
33+
var series = new FastScatterSeries();
34+
Assert.True(series.IsVisible);
35+
Assert.True(series.IsVisibleOnLegend);
36+
Assert.Null(series.ItemsSource);
37+
Assert.Equal(LabelContext.YValue, series.LabelContext);
38+
Assert.Null(series.LabelTemplate);
39+
Assert.Equal(ChartLegendIconType.Circle, series.LegendIcon);
40+
Assert.Null(series.PaletteBrushes);
41+
Assert.False(series.ShowDataLabels);
42+
Assert.Null(series.TooltipTemplate);
43+
}
44+
45+
[Fact]
46+
public void FastScatterSeriesDefaultTests_Part4()
47+
{
48+
var series = new FastScatterSeries();
49+
Assert.False(series.EnableTooltip);
50+
Assert.Null(series.Fill);
51+
Assert.Null(series.XBindingPath);
52+
Assert.Null(series.SelectionBehavior);
53+
Assert.Equal(1d, series.Opacity);
54+
Assert.False(series.EnableAnimation);
55+
Assert.False(series.IsSideBySide);
56+
}
57+
58+
[Fact]
59+
public void FastScatterSeriesDefaultTests_Part5()
60+
{
61+
var series = new FastScatterSeries();
62+
Assert.Equal(series.DataLabelSettings, series.ChartDataLabelSettings);
63+
Assert.Null(series.ChartArea);
64+
Assert.Equal(0, series.SideBySideIndex);
65+
Assert.False(series.IsSbsValueCalculated);
66+
}
67+
68+
[Fact]
69+
public void FastScatterSeriesDefaultTests_Part6()
70+
{
71+
var series = new FastScatterSeries();
72+
Assert.Null(series.Chart);
73+
Assert.Equal(1d, series.AnimationDuration);
74+
Assert.Equal(1, series.AnimationValue);
75+
Assert.Null(series.SeriesAnimation);
76+
Assert.False(series.NeedToAnimateSeries);
77+
Assert.False(series.NeedToAnimateDataLabel);
78+
Assert.False(series.SegmentsCreated);
79+
}
80+
81+
[Fact]
82+
public void FastScatterSeriesDefaultTests_Part7()
83+
{
84+
var series = new FastScatterSeries();
85+
Assert.False(series.VisibleXRange.IsEmpty);
86+
Assert.False(series.VisibleYRange.IsEmpty);
87+
Assert.False(series.PreviousXRange.IsEmpty);
88+
Assert.Null(series.OldSegments);
89+
Assert.Equal(0, series.TooltipDataPointIndex);
90+
Assert.Empty(series.GroupedXValuesIndexes);
91+
Assert.Empty(series.GroupedActualData);
92+
Assert.Empty(series.GroupedXValues);
93+
}
94+
95+
[Fact]
96+
public void FastScatterSeriesDefaultTests_Part8()
97+
{
98+
var series = new FastScatterSeries();
99+
Assert.NotNull(series.DataLabels);
100+
Assert.NotNull(series.LabelTemplateView);
101+
Assert.False(series.IsMultipleYPathRequired);
102+
Assert.Equal(0, series.XData);
103+
Assert.Equal(0, series.PointsCount);
104+
Assert.Equal(ChartValueType.Double, series.XValueType);
105+
}
106+
107+
[Fact]
108+
public void FastScatterSeriesDefaultTests_Part9()
109+
{
110+
var series = new FastScatterSeries();
111+
Assert.Null(series.XValues);
112+
Assert.Null(series.YComplexPaths);
113+
Assert.Null(series.ActualXValues);
114+
Assert.Null(series.SeriesYValues);
115+
Assert.Null(series.ActualSeriesYValues);
116+
Assert.Null(series.YPaths);
117+
Assert.Null(series.ActualData);
118+
Assert.Null(series.XComplexPaths);
119+
}
120+
121+
[Fact]
122+
public void FastScatterSeriesDefaultTests_Part10()
123+
{
124+
var series = new FastScatterSeries();
125+
Assert.True(series.IsLinearData);
126+
Assert.False(series.IsDataPointAddedDynamically);
127+
Assert.False(series.IsStacking);
128+
Assert.True(series.XRange.IsEmpty);
129+
Assert.True(series.YRange.IsEmpty);
130+
}
131+
}
132+
}

0 commit comments

Comments
 (0)