mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-20 05:48:14 +08:00
Clean up Widgets
* Move /Widgets/Live/* to /Live/* * Move /Widgets/Prompt/* to /Prompts/* * Move tests and expectations to match the new locations
This commit is contained in:

committed by
Phil Scott

parent
d532e1011f
commit
fa5a1e88ec
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Spectre.Console.Rendering;
|
||||
using Spectre.Console.Testing;
|
||||
|
||||
namespace Spectre.Console.Tests.Unit
|
||||
{
|
||||
public sealed class ProgressColumnFixture<T>
|
||||
where T : ProgressColumn, new()
|
||||
{
|
||||
public T Column { get; }
|
||||
public ProgressTask Task { get; set; }
|
||||
|
||||
public ProgressColumnFixture(double completed, double total)
|
||||
{
|
||||
Column = new T();
|
||||
Task = new ProgressTask(1, "Foo", total);
|
||||
Task.Increment(completed);
|
||||
}
|
||||
|
||||
public string Render()
|
||||
{
|
||||
var console = new TestConsole();
|
||||
var context = new RenderContext(console.Profile.Capabilities);
|
||||
console.Write(Column.Render(context, Task, TimeSpan.Zero));
|
||||
return console.Output;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user