mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Merge branch 'develop' into line-canvas-fix-offsets
This commit is contained in:
@@ -218,13 +218,13 @@ namespace Terminal.Gui.DriverTests {
|
||||
attr = new Attribute (Color.Red, Color.Green);
|
||||
Assert.True (attr.HasValidColors);
|
||||
|
||||
attr = new Attribute (Color.Red, Color.Invalid);
|
||||
attr = new Attribute (Color.Red, (Color)(-1));
|
||||
Assert.False (attr.HasValidColors);
|
||||
|
||||
attr = new Attribute (Color.Invalid, Color.Green);
|
||||
attr = new Attribute ((Color)(-1), Color.Green);
|
||||
Assert.False (attr.HasValidColors);
|
||||
|
||||
attr = new Attribute (Color.Invalid, Color.Invalid);
|
||||
attr = new Attribute ((Color)(-1), (Color)(-1));
|
||||
Assert.False (attr.HasValidColors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,5 +44,34 @@ namespace Terminal.Gui.DriverTests {
|
||||
lbl.Redraw (lbl.Bounds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestAllColors ()
|
||||
{
|
||||
var colors = System.Enum.GetValues (typeof (Color));
|
||||
Attribute [] attrs = new Attribute [colors.Length];
|
||||
|
||||
int idx = 0;
|
||||
foreach (Color bg in colors) {
|
||||
attrs [idx] = new Attribute (bg, colors.Length - 1 - bg);
|
||||
idx++;
|
||||
}
|
||||
Assert.Equal (16, attrs.Length);
|
||||
Assert.Equal (new Attribute (Color.Black, Color.White), attrs [0]);
|
||||
Assert.Equal (new Attribute (Color.Blue, Color.BrightYellow), attrs [1]);
|
||||
Assert.Equal (new Attribute (Color.Green, Color.BrightMagenta), attrs [2]);
|
||||
Assert.Equal (new Attribute (Color.Cyan, Color.BrightRed), attrs [3]);
|
||||
Assert.Equal (new Attribute (Color.Red, Color.BrightCyan), attrs [4]);
|
||||
Assert.Equal (new Attribute (Color.Magenta, Color.BrightGreen), attrs [5]);
|
||||
Assert.Equal (new Attribute (Color.Brown, Color.BrightBlue), attrs [6]);
|
||||
Assert.Equal (new Attribute (Color.Gray, Color.DarkGray), attrs [7]);
|
||||
Assert.Equal (new Attribute (Color.DarkGray, Color.Gray), attrs [8]);
|
||||
Assert.Equal (new Attribute (Color.BrightBlue, Color.Brown), attrs [9]);
|
||||
Assert.Equal (new Attribute (Color.BrightGreen, Color.Magenta), attrs [10]);
|
||||
Assert.Equal (new Attribute (Color.BrightCyan, Color.Red), attrs [11]);
|
||||
Assert.Equal (new Attribute (Color.BrightRed, Color.Cyan), attrs [12]);
|
||||
Assert.Equal (new Attribute (Color.BrightMagenta, Color.Green), attrs [13]);
|
||||
Assert.Equal (new Attribute (Color.BrightYellow, Color.Blue), attrs [14]);
|
||||
Assert.Equal (new Attribute (Color.White, Color.Black), attrs [^1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user