mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Renamed Dim.Function->Func to align iwth C# Func type.
Dim API doc fixes and code cleanup
This commit is contained in:
@@ -1086,7 +1086,7 @@ public class DimAutoTests (ITestOutputHelper output)
|
||||
public void With_Subview_Using_DimFunc ()
|
||||
{
|
||||
var view = new View ();
|
||||
var subview = new View () { Width = Dim.Function (() => 20), Height = Dim.Function (() => 25) };
|
||||
var subview = new View () { Width = Dim.Func (() => 20), Height = Dim.Func (() => 25) };
|
||||
view.Add (subview);
|
||||
|
||||
subview.SetRelativeLayout (new (100, 100));
|
||||
|
||||
@@ -14,12 +14,12 @@ public class DimFunctionTests (ITestOutputHelper output)
|
||||
Func<int> f1 = () => 0;
|
||||
Func<int> f2 = () => 0;
|
||||
|
||||
Dim dim1 = Dim.Function (f1);
|
||||
Dim dim2 = Dim.Function (f2);
|
||||
Dim dim1 = Dim.Func (f1);
|
||||
Dim dim2 = Dim.Func (f2);
|
||||
Assert.Equal (dim1, dim2);
|
||||
|
||||
f2 = () => 1;
|
||||
dim2 = Dim.Function (f2);
|
||||
dim2 = Dim.Func (f2);
|
||||
Assert.NotEqual (dim1, dim2);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class DimFunctionTests (ITestOutputHelper output)
|
||||
public void DimFunction_SetsValue ()
|
||||
{
|
||||
var text = "Test";
|
||||
Dim dim = Dim.Function (() => text.Length);
|
||||
Dim dim = Dim.Func (() => text.Length);
|
||||
Assert.Equal ("DimFunc(4)", dim.ToString ());
|
||||
|
||||
text = "New Test";
|
||||
|
||||
@@ -204,7 +204,7 @@ public class PosAnchorEndTests (ITestOutputHelper output)
|
||||
// Dim.Fill (1) fills remaining space minus 1 (16 - 1 = 15)
|
||||
// Dim.Function (Btn_Width) is 6
|
||||
// Width should be 15 - 6 = 9
|
||||
Width = Dim.Fill (1) - Dim.Function (Btn_Width),
|
||||
Width = Dim.Fill (1) - Dim.Func (Btn_Width),
|
||||
Height = 1
|
||||
};
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ public class SetRelativeLayoutTests
|
||||
Assert.Equal (1, view.Frame.Height);
|
||||
|
||||
var tf = new TextField { Text = "01234567890123456789" };
|
||||
tf.Width = Dim.Fill (1) - Dim.Function (GetViewWidth);
|
||||
tf.Width = Dim.Fill (1) - Dim.Func (GetViewWidth);
|
||||
|
||||
// tf will fill the screen minus 1 minus the width of view (3).
|
||||
// so it's width will be 26 (30 - 1 - 3).
|
||||
|
||||
Reference in New Issue
Block a user