mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-04 11:48:16 +08:00
Add Layout widget (#1041)
* Add width to panels * Add height to panels * Replace RenderContext with RenderOptions * Remove exclusivity from alternative buffer * Add Layout widget * Add Align widget
This commit is contained in:
@ -42,11 +42,13 @@ public sealed class TextTests
|
||||
public void Should_Consider_The_Longest_Word_As_Minimum_Width()
|
||||
{
|
||||
// Given
|
||||
var console = new TestConsole();
|
||||
var caps = new TestCapabilities { Unicode = true };
|
||||
var text = new Text("Foo Bar Baz\nQux\nLol mobile");
|
||||
|
||||
// When
|
||||
var result = ((IRenderable)text).Measure(caps.CreateRenderContext(), 80);
|
||||
var result = ((IRenderable)text).Measure(
|
||||
caps.CreateRenderContext(console), 80);
|
||||
|
||||
// Then
|
||||
result.Min.ShouldBe(6);
|
||||
@ -56,11 +58,13 @@ public sealed class TextTests
|
||||
public void Should_Consider_The_Longest_Line_As_Maximum_Width()
|
||||
{
|
||||
// Given
|
||||
var console = new TestConsole();
|
||||
var caps = new TestCapabilities { Unicode = true };
|
||||
var text = new Text("Foo Bar Baz\nQux\nLol mobile");
|
||||
|
||||
// When
|
||||
var result = ((IRenderable)text).Measure(caps.CreateRenderContext(), 80);
|
||||
var result = ((IRenderable)text).Measure(
|
||||
caps.CreateRenderContext(console), 80);
|
||||
|
||||
// Then
|
||||
result.Max.ShouldBe(11);
|
||||
|
Reference in New Issue
Block a user