Add constructor overload to SliderOption<T> (#3101)

* Add constructor overload to SliderOption

* Adjust whitespace

* Move tests to SliderOptionTests

* Empty commit for CI
This commit is contained in:
Thomas Nind
2023-12-31 12:45:20 +00:00
committed by GitHub
parent 55bf53336a
commit 8954fa5ecf
2 changed files with 39 additions and 0 deletions

View File

@@ -9,6 +9,26 @@ using System.Threading.Tasks;
namespace Terminal.Gui.ViewsTests;
public class SliderOptionTests {
[Fact]
public void Slider_Option_Default_Constructor ()
{
var o = new SliderOption<int> ();
Assert.Null (o.Legend);
Assert.Equal (default, o.LegendAbbr);
Assert.Equal (default, o.Data);
}
[Fact]
public void Slider_Option_Values_Constructor ()
{
var o = new SliderOption<int> ("1 thousand", new Rune ('y'), 1000);
Assert.Equal ("1 thousand", o.Legend);
Assert.Equal (new Rune ('y'), o.LegendAbbr);
Assert.Equal (1000, o.Data);
}
[Fact]
public void OnSet_Should_Raise_SetEvent ()
{