File tree 2 files changed +39
-0
lines changed
2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,25 @@ public class SliderOption<T> {
48
48
/// </summary>
49
49
public T Data { get ; set ; }
50
50
51
+ /// <summary>
52
+ /// Creates a new empty instance of the <see cref="SliderOption{T}"/> class.
53
+ /// </summary>
54
+ public SliderOption ( )
55
+ {
56
+
57
+ }
58
+
59
+ /// <summary>
60
+ /// Creates a new instance of the <see cref="SliderOption{T}"/> class with values for
61
+ /// each property.
62
+ /// </summary>
63
+ public SliderOption ( string legend , Rune legendAbbr , T data )
64
+ {
65
+ Legend = legend ;
66
+ LegendAbbr = legendAbbr ;
67
+ Data = data ;
68
+ }
69
+
51
70
/// <summary>
52
71
/// To Raise the <see cref="Set"/> event from the Slider.
53
72
/// </summary>
Original file line number Diff line number Diff line change 9
9
namespace Terminal . Gui . ViewsTests ;
10
10
11
11
public class SliderOptionTests {
12
+
13
+
14
+ [ Fact ]
15
+ public void Slider_Option_Default_Constructor ( )
16
+ {
17
+ var o = new SliderOption < int > ( ) ;
18
+ Assert . Null ( o . Legend ) ;
19
+ Assert . Equal ( default , o . LegendAbbr ) ;
20
+ Assert . Equal ( default , o . Data ) ;
21
+ }
22
+
23
+ [ Fact ]
24
+ public void Slider_Option_Values_Constructor ( )
25
+ {
26
+ var o = new SliderOption < int > ( "1 thousand" , new Rune ( 'y' ) , 1000 ) ;
27
+ Assert . Equal ( "1 thousand" , o . Legend ) ;
28
+ Assert . Equal ( new Rune ( 'y' ) , o . LegendAbbr ) ;
29
+ Assert . Equal ( 1000 , o . Data ) ;
30
+ }
31
+
12
32
[ Fact ]
13
33
public void OnSet_Should_Raise_SetEvent ( )
14
34
{
You can’t perform that action at this time.
0 commit comments